|
|||||||||
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 ContainerPlugin
c
- public Container getContainer()
public void init() throws java.lang.Exception
init
in interface Service
public void start() throws java.lang.Exception
start
in interface Service
public void stop()
stop
in interface Service
public void destroy()
destroy
in interface Service
public boolean getReclaim()
public void setReclaim(boolean reclaim)
public void add() throws java.lang.Exception
add
in interface InstancePool
Exception,
- thrown on ctx creation failurepublic EnterpriseContext get() throws java.lang.Exception
get
in interface InstancePool
java.rmi.RemoteException
- public void free(EnterpriseContext ctx)
free
in interface InstancePool
ctx
- public void discard(EnterpriseContext ctx)
InstancePool
discard
in interface InstancePool
org.jboss.ejb.InstancePool
ctx
- public int getCurrentSize()
InstancePool
getCurrentSize
in interface InstancePool
org.jboss.ejb.InstancePool
public int getMaxSize()
InstancePool
getMaxSize
in interface InstancePool
org.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 |