org.objectweb.easybeans.container.session
Class SessionFactory<PoolType>

java.lang.Object
  extended by org.objectweb.easybeans.container.AbsFactory
      extended by org.objectweb.easybeans.container.session.SessionFactory<PoolType>
Type Parameters:
PoolType - the type of bean instance.
All Implemented Interfaces:
Factory
Direct Known Subclasses:
StatefulSessionFactory, StatelessSessionFactory

public abstract class SessionFactory<PoolType>
extends AbsFactory

This class manages the session bean and its creation/lifecycle.

Author:
Florent Benoit

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 static JLog logger
          Logger.
private  Pool<PoolType,java.lang.Long> pool
          Pool that manage beans instance.
 
Constructor Summary
SessionFactory(java.lang.String className, EZBContainer container)
          Builds a new factory with a given name and its container.
 
Method Summary
protected  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.
protected  Pool<PoolType,java.lang.Long> getPool()
          Gets the pool used by this factory.
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.
protected  void setPool(Pool<PoolType,java.lang.Long> pool)
          Sets the pool used by this factory.
 void stop()
          Stops the factory.
 
Methods inherited from class org.objectweb.easybeans.container.AbsFactory
rpcInvoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static JLog logger
Logger.


className

private java.lang.String className
Name of the class of the managed bean.


container

private EZBContainer container
Container that created this factory.


hashes

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


pool

private Pool<PoolType,java.lang.Long> pool
Pool that manage beans instance.


beanClass

private java.lang.Class<PoolType> beanClass
Class used to build bean's instance.

Constructor Detail

SessionFactory

public SessionFactory(java.lang.String className,
                      EZBContainer container)
               throws FactoryException
Builds a new factory with a given name and its container.

Parameters:
className - name of this factory (name of class that is managed)
container - the root component of this factory.
Throws:
FactoryException - if class can't be loaded.
Method Detail

getBeanClass

protected java.lang.Class<PoolType> getBeanClass()
Gets the bean's class.

Returns:
bean class used to instantiate beans.

setBeanClass

protected void setBeanClass(java.lang.Class<PoolType> beanClass)
Sets the bean class that will be used to build bean's instance.

Parameters:
beanClass - the instance of the bean class name

setPool

protected void setPool(Pool<PoolType,java.lang.Long> pool)
Sets the pool used by this factory.

Parameters:
pool - the pool which managed bean instances

getHashes

protected java.util.Map<java.lang.Long,java.lang.reflect.Method> getHashes()
Gets the computed hashes.

Returns:
computed hashes

setHashes

protected void setHashes(java.util.Map<java.lang.Long,java.lang.reflect.Method> hashes)
Sets the hashes for the current bean class.

Parameters:
hashes - method hashes computed as RMI hashes

stop

public void stop()
Stops the factory.


getContainer

public EZBContainer getContainer()
Gets the container used by this factory.

Returns:
container of this factory

getClassName

public java.lang.String getClassName()
Gets the className used by this factory.

Returns:
classname that will be instantiated to build bean instance.

getPool

protected Pool<PoolType,java.lang.Long> getPool()
Gets the pool used by this factory.

Returns:
pool.