|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.container.AbsFactory<PoolType>
PoolType
- the type of bean instance.public abstract class AbsFactory<PoolType extends EasyBeansBean>
Abstract factory which implements common and defaults methods.
It should be extended by Bean factories.
Field Summary | |
---|---|
private java.lang.Class<PoolType> |
beanClass
Class used to build bean's instance. |
private java.lang.String |
className
Name of the class of the managed bean. |
private EZBContainer |
container
Container that created this factory. |
private java.util.Map<java.lang.Long,java.lang.reflect.Method> |
hashes
Keep a direct reference to the method so that we don't need to compute each time the method object to invoke. http://java.sun.com/j2se/1.5.0/docs/guide/rmi/spec/rmi-stubs24.html |
private java.util.List<ResourceInjector> |
injectors
List of external Resources injectors. |
private javax.naming.Context |
javaContext
Context for java: lookups. |
private static JLog |
logger
Logger. |
private static NamingManager |
namingManager
Reference on the naming manager. |
private Pool<PoolType,java.lang.Long> |
pool
Pool that manage beans instance. |
Constructor Summary | |
---|---|
AbsFactory(java.lang.String className,
EZBContainer container)
Builds a new factory with a given name and its container. |
Method Summary | |
---|---|
java.lang.Class<PoolType> |
getBeanClass()
Gets the bean's class. |
java.lang.String |
getClassName()
Gets the className used by this factory. |
EZBContainer |
getContainer()
Gets the container used by this factory. |
protected java.util.Map<java.lang.Long,java.lang.reflect.Method> |
getHashes()
Gets the computed hashes. |
javax.naming.Context |
getJavaContext()
Gets the java: context. |
protected static NamingManager |
getNamingManager()
Gets the reference on the naming manager. |
Pool<PoolType,java.lang.Long> |
getPool()
Gets the pool used by this factory. |
void |
init()
Init the factory. |
protected void |
injectResources(PoolType instance)
Injects Resources into the Bean. |
void |
remove(PoolType instance)
Callback called when object is gonna be removed. |
abstract EJBResponse |
rpcInvoke(EJBRequest request)
A request comes to the bean factory and needs to be handled. A response is done which contains the answer. |
protected void |
setBeanClass(java.lang.Class<PoolType> beanClass)
Sets the bean class that will be used to build bean's instance. |
protected void |
setHashes(java.util.Map<java.lang.Long,java.lang.reflect.Method> hashes)
Sets the hashes for the current bean class. |
void |
setJavaContext(javax.naming.Context javaContext)
Sets the java: context. |
protected void |
setPool(Pool<PoolType,java.lang.Long> pool)
Sets the pool used by this factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.easybeans.api.Factory |
---|
getBeanInfo, localCall, stop |
Field Detail |
---|
private static JLog logger
private java.lang.String className
private EZBContainer container
private Pool<PoolType extends EasyBeansBean,java.lang.Long> pool
private java.lang.Class<PoolType extends EasyBeansBean> beanClass
private javax.naming.Context javaContext
private static NamingManager namingManager
private java.util.List<ResourceInjector> injectors
private java.util.Map<java.lang.Long,java.lang.reflect.Method> hashes
Constructor Detail |
---|
public AbsFactory(java.lang.String className, EZBContainer container) throws FactoryException
className
- name of this factory (name of class that is managed)container
- the root component of this factory.
FactoryException
- if class can't be loaded.Method Detail |
---|
public void remove(PoolType instance)
instance
- that is being removed from the pool.protected void injectResources(PoolType instance) throws PoolException
instance
- The Bean instance to be injected.
PoolException
- if resources cannot be injected.protected java.util.Map<java.lang.Long,java.lang.reflect.Method> getHashes()
protected void setHashes(java.util.Map<java.lang.Long,java.lang.reflect.Method> hashes)
hashes
- method hashes computed as RMI hashespublic javax.naming.Context getJavaContext()
getJavaContext
in interface Factory<PoolType extends EasyBeansBean,java.lang.Long>
public void setJavaContext(javax.naming.Context javaContext)
setJavaContext
in interface Factory<PoolType extends EasyBeansBean,java.lang.Long>
javaContext
- the java: context.public java.lang.Class<PoolType> getBeanClass()
protected void setBeanClass(java.lang.Class<PoolType> beanClass)
beanClass
- the instance of the bean class nameprotected void setPool(Pool<PoolType,java.lang.Long> pool)
pool
- the pool which managed bean instancespublic EZBContainer getContainer()
getContainer
in interface Factory<PoolType extends EasyBeansBean,java.lang.Long>
public java.lang.String getClassName()
protected static NamingManager getNamingManager()
public Pool<PoolType,java.lang.Long> getPool()
getPool
in interface Factory<PoolType extends EasyBeansBean,java.lang.Long>
public abstract EJBResponse rpcInvoke(EJBRequest request)
rpcInvoke
in interface Factory<PoolType extends EasyBeansBean,java.lang.Long>
request
- the EJB request.
public void init() throws FactoryException
init
in interface Factory<PoolType extends EasyBeansBean,java.lang.Long>
FactoryException
- if the initialization fails.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |