|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sadun.util.pool.ObjectPool.BaseFactory org.sadun.util.pool.EjbFactory
An ExtendedObjectPool.Factory
implementation which uses reflection
to create instances of enterprise java beans, looking up the home interface and invoking a
proper create() method.
The JNDI name and the home interface class of the EJB to pool must be provided at construction.
After creation, objects can be optionally setup by an user-provided class implementing
the Setup
interface.
Field Summary |
Fields inherited from class org.sadun.util.pool.ObjectPool.BaseFactory |
cls, paramCls, params, ps |
Constructor Summary | |
EjbFactory(java.lang.String jndiName,
java.lang.Class remoteInterface)
|
|
EjbFactory(java.lang.String jndiName,
java.lang.Class remoteInterface,
java.lang.Object[] params)
|
|
EjbFactory(java.lang.String jndiName,
java.lang.Class remoteInterface,
java.lang.Object[] params,
Setup ps)
Create a factory which makes use of a create() method on the home interface of an EJB with the given JNDI name and expecting the given parameters; after creation, the given Setup object will be used for post initialization. |
Method Summary | |
java.lang.Object |
create()
Subclasses must implement the code which actually creates a new instance of the class to pool. |
void |
destroy(java.lang.Object obj)
This implementation does not do anything. |
javax.ejb.EJBHome |
getEJBHome()
Get the home interface used by this factory to produce Enterprise Java Beans |
java.lang.String |
getJNDIName()
Return the JNDI name of the Enterprise Java Bean produced by this factory |
Methods inherited from class org.sadun.util.pool.ObjectPool.BaseFactory |
getProducedClass |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EjbFactory(java.lang.String jndiName, java.lang.Class remoteInterface, java.lang.Object[] params, Setup ps)
Setup
object will be used for post initialization.
jndiName
- the JNDI name of the EJB's home interfaceremoteInterface
- the remote interface of the EJBparams
- the types of the parameters expected by the EJB's create() method, or nullps
- the Setup
object to be used for post-construction setup, or nullpublic EjbFactory(java.lang.String jndiName, java.lang.Class remoteInterface, java.lang.Object[] params)
public EjbFactory(java.lang.String jndiName, java.lang.Class remoteInterface)
Method Detail |
public java.lang.Object create() throws ObjectPool.ObjectPoolException
ObjectPool.BaseFactory
create
in interface ObjectPool.Factory
create
in class ObjectPool.BaseFactory
ObjectPool.ObjectPoolException
public void destroy(java.lang.Object obj)
destroy
in interface ObjectPool.Factory
destroy
in class ObjectPool.BaseFactory
public java.lang.String getJNDIName()
public javax.ejb.EJBHome getEJBHome()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |