|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.jboss.ejb.plugins.AbstractInstancePool
Abstract Instance Pool class containing the basic logic to create an EJB Instance Pool.
Revisions:
20010704 marcf:
20010920 Sacha Labourey:
20011208 Vincent Harcq:
| Field Summary | |
protected Container |
container
The Container the instance pool is associated with |
protected Logger |
log
The logging interface |
protected int |
maxSize
The maximum number of instances allowed in the pool |
protected java.util.Stack |
pool
The instance pool stack |
protected InstancePoolFeeder |
poolFeeder
The pool seed task set from the feeder-policy config element |
protected boolean |
reclaim
determine if we reuse EnterpriseContext objects i.e. |
| Constructor Summary | |
AbstractInstancePool()
|
|
| Method Summary | |
void |
add()
Add a instance in the pool by invoking create() with a new bean instance. |
protected abstract EnterpriseContext |
create(java.lang.Object instance)
|
void |
destroy()
|
void |
discard(EnterpriseContext ctx)
Discard an anonymous instance after invocation. |
void |
free(EnterpriseContext ctx)
Return an instance after invocation. |
EnterpriseContext |
get()
Get an instance without identity. |
Container |
getContainer()
|
int |
getCurrentSize()
Return the size of the pool. |
int |
getMaxSize()
Get the maximum size of the pool. |
boolean |
getReclaim()
A pool is reclaim if it push back its dirty instances in its stack. |
void |
importXml(org.w3c.dom.Element element)
XmlLoadable implementation |
void |
init()
|
void |
setContainer(Container c)
Set the callback to the container. |
void |
setReclaim(boolean reclaim)
|
void |
start()
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Logger log
protected Container container
protected java.util.Stack pool
protected int maxSize
protected boolean reclaim
protected InstancePoolFeeder poolFeeder
| Constructor Detail |
public AbstractInstancePool()
| Method Detail |
public void setContainer(Container c)
setContainer in interface ContainerPluginc - public Container getContainer()
public void init()
throws java.lang.Exception
init in interface Service
public void start()
throws java.lang.Exception
start in interface Servicepublic void stop()
stop in interface Servicepublic void destroy()
destroy in interface Servicepublic boolean getReclaim()
public void setReclaim(boolean reclaim)
public void add()
throws java.lang.Exception
add in interface InstancePoolException, - thrown on ctx creation failure
public EnterpriseContext get()
throws java.lang.Exception
get in interface InstancePooljava.rmi.RemoteException - public void free(EnterpriseContext ctx)
free in interface InstancePoolctx - public void discard(EnterpriseContext ctx)
InstancePooldiscard in interface InstancePoolorg.jboss.ejb.InstancePoolctx - public int getCurrentSize()
InstancePoolgetCurrentSize in interface InstancePoolorg.jboss.ejb.InstancePoolpublic int getMaxSize()
InstancePoolgetMaxSize in interface InstancePoolorg.jboss.ejb.InstancePool
public void importXml(org.w3c.dom.Element element)
throws DeploymentException
importXml in interface XmlLoadable
protected abstract EnterpriseContext create(java.lang.Object instance)
throws java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||