org.objectweb.easybeans.api
Interface Factory<PoolType,Clue>

Type Parameters:
PoolType - The type of the pool.
Clue - The clue used by the pool.
All Known Implementing Classes:
AbsFactory, MDBFactory, MDBMessageEndPointFactory, SessionFactory, StatefulSessionFactory, StatelessSessionFactory

public interface Factory<PoolType,Clue>

This interface is used by all bean factories of EJB 3 container.

Author:
Florent Benoit

Method Summary
 IBeanInfo getBeanInfo()
          Gets the bean information.
 java.lang.String getClassName()
          Gets the className used by this factory.
 EZBContainer getContainer()
          Gets the container used by this factory.
 java.lang.String getId()
          Gets an id for this factory.
 javax.naming.Context getJavaContext()
          Gets the java: context.
 Pool<PoolType,Clue> getPool()
          Gets the pool used by this factory.
 void init()
          Init the factory.
 EJBResponse localCall(long hash, java.lang.Object[] methodArgs, java.lang.Long beanId)
          Do a local call on a method of this factory.
 EJBResponse rpcInvoke(EJBRequest request)
          A remote request comes to the bean factory and needs to be handled.
A response is done which contains the answer.
 void setJavaContext(javax.naming.Context javaContext)
          Sets the java: context.
 void stop()
          Stops the factory.
 

Method Detail

rpcInvoke

EJBResponse rpcInvoke(EJBRequest request)
A remote request comes to the bean factory and needs to be handled.
A response is done which contains the answer.

Parameters:
request - the EJB request.
Returns:
a response that have been processed by the factory.

localCall

EJBResponse localCall(long hash,
                      java.lang.Object[] methodArgs,
                      java.lang.Long beanId)
Do a local call on a method of this factory.

Parameters:
hash - the hash of the method to execute.
methodArgs - the arguments of the method
beanId - the id of the bean that we want (stateful).
Returns:
response container new id (if any) and value.

init

void init()
          throws FactoryException
Init the factory.

Throws:
FactoryException - if the initialization fails.

stop

void stop()
Stops the factory.


getClassName

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

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

getContainer

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

Returns:
container of this factory

getJavaContext

javax.naming.Context getJavaContext()
Gets the java: context.

Returns:
java: context.

setJavaContext

void setJavaContext(javax.naming.Context javaContext)
Sets the java: context.

Parameters:
javaContext - the java: context.

getBeanInfo

IBeanInfo getBeanInfo()
Gets the bean information.

Returns:
bean information

getPool

Pool<PoolType,Clue> getPool()
Gets the pool used by this factory.

Returns:
pool.

getId

java.lang.String getId()
Gets an id for this factory.

Returns:
string id.