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

Type Parameters:
PoolType - The type of the pool.
Clue - The clue used by the pool.
All Superinterfaces:
EZBJ2EEManagedObject
All Known Subinterfaces:
EZBStatefulSessionFactory<PoolType,Clue>

public interface Factory<PoolType,Clue>
extends EZBJ2EEManagedObject

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

Author:
Florent Benoit

Method Summary
 IBeanInfo getBeanInfo()
          Gets the bean information.
 String getClassName()
          Gets the className used by this factory.
 EZBContainer getContainer()
          Gets the container used by this factory.
 InheritableThreadLocal<Map<String,Object>> getContextDataThreadLocal()
           
 String getId()
          Gets an id for this factory.
 EZBInvocationContextFactory getInvocationContextFactory()
           
 Context getJavaContext()
          Gets the java: context.
 OperationState getOperationState()
           
 InheritableThreadLocal<OperationState> getOperationStateThreadLocal()
           
 org.ow2.util.pool.api.Pool<PoolType,Clue> getPool()
          Gets the pool used by this factory.
 EZBTimerService getTimerService()
          Gets the timer service of this factory.
 void init()
          Init the factory.
 EJBResponse localCall(EJBLocalRequest localCallRequest)
          Do a local call on a method of this factory.
 void notifyTimeout(javax.ejb.Timer timer, IMethodInfo methodInfo)
          Notified when the timer service send a Timer object.
 EJBResponse rpcInvoke(EJBRemoteRequest request)
          A remote request comes to the bean factory and needs to be handled.
A response is done which contains the answer.
 void setInvocationContextFactory(EZBInvocationContextFactory invocationContextFactory)
          Defines the invocation context factory (for dynamic mode).
 void setJavaContext(Context javaContext)
          Sets the java: context.
 void start()
          Starts the factory.
 void stop()
          Stops the factory.
 
Methods inherited from interface org.ow2.easybeans.api.EZBJ2EEManagedObject
getComponent, getJ2EEManagedObjectId
 

Method Detail

rpcInvoke

EJBResponse rpcInvoke(EJBRemoteRequest 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(EJBLocalRequest localCallRequest)
Do a local call on a method of this factory.

Parameters:
localCallRequest - the given request
Returns:
response with the value of the call and the bean ID (if any)

notifyTimeout

void notifyTimeout(javax.ejb.Timer timer,
                   IMethodInfo methodInfo)
Notified when the timer service send a Timer object. It has to call the Timed method.

Parameters:
timer - the given timer object that will be given to the timer method.
methodInfo - the method to use for the callback if applied on a specific method

init

void init()
          throws FactoryException
Init the factory.

Throws:
FactoryException - if the initialization fails.

start

void start()
           throws FactoryException
Starts the factory.

Throws:
FactoryException - if factory doesn't start

stop

void stop()
Stops the factory.


getClassName

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

Context getJavaContext()
Gets the java: context.

Returns:
java: context.

setJavaContext

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

Parameters:
javaContext - the java: context.

getBeanInfo

IBeanInfo getBeanInfo()
Gets the bean information.

Returns:
bean information

getPool

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

Returns:
pool.

getId

String getId()
Gets an id for this factory.

Returns:
string id.

getTimerService

EZBTimerService getTimerService()
Gets the timer service of this factory.

Returns:
the timer service.

setInvocationContextFactory

void setInvocationContextFactory(EZBInvocationContextFactory invocationContextFactory)
Defines the invocation context factory (for dynamic mode).

Parameters:
invocationContextFactory - the given invocation context factory

getInvocationContextFactory

EZBInvocationContextFactory getInvocationContextFactory()
Returns:
the invocation context factory (for dynamic mode).

getOperationState

OperationState getOperationState()
Returns:
the current operation state.

getOperationStateThreadLocal

InheritableThreadLocal<OperationState> getOperationStateThreadLocal()
Returns:
the current operation state thread local.

getContextDataThreadLocal

InheritableThreadLocal<Map<String,Object>> getContextDataThreadLocal()
Returns:
the current context map of the current invocation


Copyright © 2006-2012 OW2 Consortium. All Rights Reserved.