org.jboss.ejb
Interface InstancePool

All Superinterfaces:
AllowedOperationsFlags (src) , ContainerPlugin (src) , Service (src)
All Known Implementing Classes:
AbstractInstancePool (src)

public interface InstancePool
extends ContainerPlugin (src)

Defines the model for a EnterpriseContext instance pool.


Field Summary
 
Fields inherited from interface org.jboss.ejb.AllowedOperationsFlags (src)
IN_AFTER_BEGIN, IN_AFTER_COMPLETION, IN_BEFORE_COMPLETION, IN_BUSINESS_METHOD, IN_EJB_ACTIVATE, IN_EJB_CREATE, IN_EJB_FIND, IN_EJB_HOME, IN_EJB_LOAD, IN_EJB_PASSIVATE, IN_EJB_POST_CREATE, IN_EJB_REMOVE, IN_EJB_STORE, IN_EJB_TIMEOUT, IN_INTERCEPTOR_METHOD, IN_SERVICE_ENDPOINT_METHOD, IN_SET_ENTITY_CONTEXT, IN_SET_MESSAGE_DRIVEN_CONTEXT, IN_SET_SESSION_CONTEXT, IN_UNSET_ENTITY_CONTEXT, NOT_ALLOWED
 
Method Summary
 void discard(EnterpriseContext (src)  ctx)
          Discard an anonymous instance after invocation.
 void free(EnterpriseContext (src)  ctx)
          Return an anonymous instance after invocation.
 EnterpriseContext (src) get()
          Get an instance without identity.
 int getCurrentSize()
          Return the size of the pool.
 int getMaxSize()
          Get the maximum size of the pool.
 
Methods inherited from interface org.jboss.ejb.ContainerPlugin (src)
setContainer
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Method Detail

get

public EnterpriseContext (src)  get()
                      throws java.lang.Exception
Get an instance without identity.

Can be used by finders and create-methods, or stateless beans

Returns:
Context/w instance
Throws:
java.lang.Exception - RemoteException

free

public void free(EnterpriseContext (src)  ctx)
Return an anonymous instance after invocation.

Parameters:
ctx - The context to free.

discard

public void discard(EnterpriseContext (src)  ctx)
Discard an anonymous instance after invocation. This is called if the instance should not be reused, perhaps due to some exception being thrown from it.

Parameters:
ctx - The context to discard.

getCurrentSize

public int getCurrentSize()
Return the size of the pool.

Returns:
the size of the pool.

getMaxSize

public int getMaxSize()
Get the maximum size of the pool.

Returns:
the size of the pool.