org.jboss.proxy.ejb
Class IORFactory

java.lang.Object
  extended byorg.jboss.proxy.ejb.IORFactory
All Implemented Interfaces:
AllowedOperationsFlags (src) , ContainerPlugin (src) , EJBProxyFactory (src) , GenericEntityObjectFactory (src) , Service (src)

public class IORFactory
extends java.lang.Object
implements EJBProxyFactory (src)

This is an IIOP "proxy factory" for EJBHomes and EJBObjects. Rather than creating Java proxies (as the JRMP proxy factory does), this factory creates CORBA IORs.

An IORFactory is associated to a given enterprise bean. It registers with the IIOP invoker two CORBA servants: an EjbHomeCorbaServant for the bean's EJBHome and an EjbObjectCorbaServant for the bean's EJBObjects.


Nested Class Summary
 
Nested classes inherited from class org.jboss.ejb.GenericEntityObjectFactory (src)
GenericEntityObjectFactory.UTIL (src)
 
Field Summary
 
Fields inherited from interface org.jboss.ejb.AllowedOperationsFlags (src)
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
IORFactory()
           
 
Method Summary
 void create()
          create the service, do expensive operations etc
 void destroy()
          destroy the service, tear down
 java.lang.Object getEJBHome()
          This method is called whenever the EJBHome implementation for this container is needed.
 EJBMetaData (src) getEJBMetaData()
          This method is called whenever the metadata for this container is needed.
 java.util.Collection getEntityCollection(java.util.Collection ids)
          This method is called whenever a collection of EJBObjects for a collection of primary keys is needed.
 java.lang.Object getEntityEJBObject(java.lang.Object id)
          This method is called whenever an EJBObject implementation for an entitybean is needed.
 java.lang.Object getStatefulSessionEJBObject(java.lang.Object id)
          This method is called whenever an EJBObject implementation for a stateful session bean is needed.
 java.lang.Object getStatelessSessionEJBObject()
          This method is called whenever an EJBObject implementation for a stateless session bean is needed.
 boolean isIdentical(Container (src)  container, Invocation (src)  mi)
          Protocol specific isIdentical implementation
static void rebind(org.omg.CosNaming.NamingContextExt ctx, java.lang.String strName, org.omg.CORBA.Object obj)
          (Re)binds an object to a name in a given CORBA naming context, creating any non-existent intermediate contexts along the way.
static java.lang.String rmiRepositoryId(java.lang.Class clz)
          Returns the CORBA repository id of a given the RMI-IDL interface.
 void setContainer(Container (src)  container)
          This callback is set by the container so that the plugin may access it
 void setInvokerBinding(java.lang.String binding)
          Set the invoker jndi binding
 void setInvokerMetaData(InvokerProxyBindingMetaData (src)  imd)
          Set the invoker meta data so that the ProxyFactory can initialize properly
 void start()
          start the service, create is already called
 void stop()
          stop the service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IORFactory

public IORFactory()
Method Detail

setContainer

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

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

create

public void create()
            throws java.lang.Exception
Description copied from interface: Service (src)
create the service, do expensive operations etc

Specified by:
create in interface Service (src)
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Description copied from interface: Service (src)
start the service, create is already called

Specified by:
start in interface Service (src)
Throws:
java.lang.Exception

stop

public void stop()
Description copied from interface: Service (src)
stop the service

Specified by:
stop in interface Service (src)

destroy

public void destroy()
Description copied from interface: Service (src)
destroy the service, tear down

Specified by:
destroy in interface Service (src)

setInvokerMetaData

public void setInvokerMetaData(InvokerProxyBindingMetaData (src)  imd)
Description copied from interface: EJBProxyFactory (src)
Set the invoker meta data so that the ProxyFactory can initialize properly

Specified by:
setInvokerMetaData in interface EJBProxyFactory (src)

setInvokerBinding

public void setInvokerBinding(java.lang.String binding)
Description copied from interface: EJBProxyFactory (src)
Set the invoker jndi binding

Specified by:
setInvokerBinding in interface EJBProxyFactory (src)

isIdentical

public boolean isIdentical(Container (src)  container,
                           Invocation (src)  mi)
Description copied from interface: EJBProxyFactory (src)
Protocol specific isIdentical implementation

Specified by:
isIdentical in interface EJBProxyFactory (src)
Parameters:
container - the container
mi - the invocation
Returns:
true when identical, false otherwise

getEJBMetaData

public EJBMetaData (src)  getEJBMetaData()
Description copied from interface: EJBProxyFactory (src)
This method is called whenever the metadata for this container is needed.

Specified by:
getEJBMetaData in interface EJBProxyFactory (src)
Returns:
An implementation of the EJBMetaData interface.

getEJBHome

public java.lang.Object getEJBHome()
Description copied from interface: EJBProxyFactory (src)
This method is called whenever the EJBHome implementation for this container is needed.

Specified by:
getEJBHome in interface EJBProxyFactory (src)
Returns:
An implementation of the home interface for this container.

getStatelessSessionEJBObject

public java.lang.Object getStatelessSessionEJBObject()
Description copied from interface: EJBProxyFactory (src)
This method is called whenever an EJBObject implementation for a stateless session bean is needed.

Specified by:
getStatelessSessionEJBObject in interface EJBProxyFactory (src)
Returns:
An implementation of the remote interface for this container.

getStatefulSessionEJBObject

public java.lang.Object getStatefulSessionEJBObject(java.lang.Object id)
Description copied from interface: EJBProxyFactory (src)
This method is called whenever an EJBObject implementation for a stateful session bean is needed.

Specified by:
getStatefulSessionEJBObject in interface EJBProxyFactory (src)
Parameters:
id - The id of the session.
Returns:
An implementation of the remote interface for this container.

getEntityEJBObject

public java.lang.Object getEntityEJBObject(java.lang.Object id)
Description copied from interface: EJBProxyFactory (src)
This method is called whenever an EJBObject implementation for an entitybean is needed.

Specified by:
getEntityEJBObject in interface EJBProxyFactory (src)
Parameters:
id - The primary key of the entity.
Returns:
An implementation of the remote interface for this container.

getEntityCollection

public java.util.Collection getEntityCollection(java.util.Collection ids)
Description copied from interface: EJBProxyFactory (src)
This method is called whenever a collection of EJBObjects for a collection of primary keys is needed.

Specified by:
getEntityCollection in interface EJBProxyFactory (src)
Parameters:
ids - Enumeration of primary keys.
Returns:
A collection of EJBObjects implementing the remote interface for this container.

rmiRepositoryId

public static java.lang.String rmiRepositoryId(java.lang.Class clz)
Returns the CORBA repository id of a given the RMI-IDL interface.


rebind

public static void rebind(org.omg.CosNaming.NamingContextExt ctx,
                          java.lang.String strName,
                          org.omg.CORBA.Object obj)
                   throws java.lang.Exception
(Re)binds an object to a name in a given CORBA naming context, creating any non-existent intermediate contexts along the way.

Throws:
java.lang.Exception