org.jboss.ejb.plugins.local
Class BaseLocalProxyFactory

java.lang.Object
  extended by org.jboss.ejb.plugins.local.BaseLocalProxyFactory
All Implemented Interfaces:
AllowedOperationsFlags, ContainerPlugin, GenericEntityObjectFactory, LocalProxyFactory, org.jboss.system.Service

public class BaseLocalProxyFactory
extends Object
implements LocalProxyFactory

The LocalProxyFactory implementation that handles local ejb interface proxies.

Author:
Daniel OConnor, Scott Stark, Dain Sundstrom, Alexey Loubyansky $Revision: 57209 $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.ejb.GenericEntityObjectFactory
GenericEntityObjectFactory.UTIL
 
Field Summary
protected  Map beanMethodInvokerMap
           
protected  Container container
           
protected  javax.ejb.EJBLocalHome home
           
protected  Map homeMethodInvokerMap
           
protected static Map invokerMap
          A map of the BaseLocalProxyFactory instances keyed by localJndiName
protected  Class localClass
           
protected  Class localHomeClass
           
protected  String localJndiName
          The JNDI name of the local home interface binding
protected static org.jboss.logging.Logger log
           
protected  Constructor proxyClassConstructor
           
protected  javax.ejb.EJBLocalObject statelessObject
           
protected  TransactionManager transactionManager
           
 
Fields inherited from interface org.jboss.ejb.AllowedOperationsFlags
IN_AFTER_BEGIN, IN_AFTER_COMPLETION, IN_BEFORE_COMPLETION, IN_BUSINESS_METHOD, IN_EJB_ACTIVATE, IN_EJB_CREATE, IN_EJB_FIND, IN_EJB_HOME, IN_EJB_LOAD, IN_EJB_PASSIVATE, IN_EJB_POST_CREATE, IN_EJB_REMOVE, IN_EJB_STORE, IN_EJB_TIMEOUT, IN_INTERCEPTOR_METHOD, IN_SERVICE_ENDPOINT_METHOD, IN_SET_ENTITY_CONTEXT, IN_SET_MESSAGE_DRIVEN_CONTEXT, IN_SET_SESSION_CONTEXT, IN_UNSET_ENTITY_CONTEXT, NOT_ALLOWED
 
Constructor Summary
BaseLocalProxyFactory()
           
 
Method Summary
 void create()
           
 void destroy()
           
 javax.ejb.EJBLocalHome getEJBLocalHome()
          This method is called whenever the EJBLocalHome implementation for this container is needed.
 javax.ejb.EJBLocalObject getEntityEJBLocalObject(Object id)
          This method is called whenever an EJBLocalObject implementation for an entitybean is needed.
 javax.ejb.EJBLocalObject getEntityEJBLocalObject(Object id, boolean create)
          This method is called whenever a new EJBLocalObject should be created.
 Object getEntityEJBObject(Object id)
           
 Collection getEntityLocalCollection(Collection ids)
          This method is called whenever a collection of EJBLocalObjects for a collection of primary keys is needed.
 String getJndiName()
           
 Constructor getProxyClassConstructor()
           
 javax.ejb.EJBLocalObject getStatefulSessionEJBLocalObject(Object id)
          This method is called whenever an EJBLocalObject implementation for a stateful session bean is needed.
 javax.ejb.EJBLocalObject getStatelessSessionEJBLocalObject()
          This method is called whenever an EJBLocalObject implementation for a stateless session bean is needed.
 Object invoke(Object id, Method m, Object[] args)
          Invoke a local interface method.
 Object invokeHome(Method m, Object[] args)
          Invoke a Home interface method.
 void setContainer(Container con)
          This callback is set by the container so that the plugin may access it
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.jboss.logging.Logger log

invokerMap

protected static Map invokerMap
A map of the BaseLocalProxyFactory instances keyed by localJndiName


container

protected Container container

localJndiName

protected String localJndiName
The JNDI name of the local home interface binding


transactionManager

protected TransactionManager transactionManager

home

protected javax.ejb.EJBLocalHome home

statelessObject

protected javax.ejb.EJBLocalObject statelessObject

beanMethodInvokerMap

protected Map beanMethodInvokerMap

homeMethodInvokerMap

protected Map homeMethodInvokerMap

localHomeClass

protected Class localHomeClass

localClass

protected Class localClass

proxyClassConstructor

protected Constructor proxyClassConstructor
Constructor Detail

BaseLocalProxyFactory

public BaseLocalProxyFactory()
Method Detail

setContainer

public void setContainer(Container con)
Description copied from interface: ContainerPlugin
This callback is set by the container so that the plugin may access it

Specified by:
setContainer in interface ContainerPlugin
Parameters:
con - The container using this plugin. This may be null if the plugin is being disassociated from a container.

create

public void create()
            throws Exception
Specified by:
create in interface org.jboss.system.Service
Throws:
Exception

start

public void start()
           throws Exception
Specified by:
start in interface org.jboss.system.Service
Throws:
Exception

stop

public void stop()
Specified by:
stop in interface org.jboss.system.Service

destroy

public void destroy()
Specified by:
destroy in interface org.jboss.system.Service

getProxyClassConstructor

public Constructor getProxyClassConstructor()

getEJBLocalHome

public javax.ejb.EJBLocalHome getEJBLocalHome()
Description copied from interface: LocalProxyFactory
This method is called whenever the EJBLocalHome implementation for this container is needed.

Specified by:
getEJBLocalHome in interface LocalProxyFactory
Returns:
an implementation of the local home interface for this container

getStatelessSessionEJBLocalObject

public javax.ejb.EJBLocalObject getStatelessSessionEJBLocalObject()
Description copied from interface: LocalProxyFactory
This method is called whenever an EJBLocalObject implementation for a stateless session bean is needed.

Specified by:
getStatelessSessionEJBLocalObject in interface LocalProxyFactory
Returns:
an implementation of the local interface for this container

getStatefulSessionEJBLocalObject

public javax.ejb.EJBLocalObject getStatefulSessionEJBLocalObject(Object id)
Description copied from interface: LocalProxyFactory
This method is called whenever an EJBLocalObject implementation for a stateful session bean is needed.

Specified by:
getStatefulSessionEJBLocalObject in interface LocalProxyFactory
Parameters:
id - the id of the session
Returns:
an implementation of the local interface for this container

getEntityEJBObject

public Object getEntityEJBObject(Object id)
Specified by:
getEntityEJBObject in interface GenericEntityObjectFactory

getEntityEJBLocalObject

public javax.ejb.EJBLocalObject getEntityEJBLocalObject(Object id,
                                                        boolean create)
Description copied from interface: LocalProxyFactory
This method is called whenever a new EJBLocalObject should be created. Called when the instance is created.

Specified by:
getEntityEJBLocalObject in interface LocalProxyFactory
Parameters:
id - the primary key of the entity
Returns:
an implementation of the local interface for this container

getEntityEJBLocalObject

public javax.ejb.EJBLocalObject getEntityEJBLocalObject(Object id)
Description copied from interface: LocalProxyFactory
This method is called whenever an EJBLocalObject implementation for an entitybean is needed.

Specified by:
getEntityEJBLocalObject in interface LocalProxyFactory
Parameters:
id - the primary key of the entity
Returns:
an implementation of the local interface for this container

getEntityLocalCollection

public Collection getEntityLocalCollection(Collection ids)
Description copied from interface: LocalProxyFactory
This method is called whenever a collection of EJBLocalObjects for a collection of primary keys is needed.

Specified by:
getEntityLocalCollection in interface LocalProxyFactory
Parameters:
ids - enumeration of primary keys
Returns:
a collection of EJBLocalObjects implementing the remote interface for this container

invokeHome

public Object invokeHome(Method m,
                         Object[] args)
                  throws Exception
Invoke a Home interface method.

Throws:
Exception

getJndiName

public String getJndiName()

invoke

public Object invoke(Object id,
                     Method m,
                     Object[] args)
              throws Exception
Invoke a local interface method.

Throws:
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.