com.caucho.ejb.message
Class MessageManager<X>

java.lang.Object
  extended by com.caucho.ejb.server.AbstractEjbBeanManager<X>
      extended by com.caucho.ejb.message.MessageManager<X>
All Implemented Interfaces:
EnvironmentBean, MessageEndpointFactory

@Module
public class MessageManager<X>
extends AbstractEjbBeanManager<X>
implements MessageEndpointFactory

JCA activation-spec server container for a message bean.


Field Summary
protected static java.util.logging.Logger log
           
 
Fields inherited from class com.caucho.ejb.server.AbstractEjbBeanManager
_ejbClass, _ejbManager, _filename, _line, _location, _mappedName, _ut
 
Constructor Summary
MessageManager(EjbManager ejbContainer, java.lang.String ejbName, java.lang.String moduleName, AnnotatedType<X> rawAnnType, AnnotatedType<X> annotatedType, EjbLazyGenerator<X> lazyGenerator)
           
 
Method Summary
 void bind()
           
protected  void bindContext()
           
protected  BeanGenerator<X> createBeanGenerator()
          Creates the bean generator for the session bean.
 MessageEndpoint createEndpoint(XAResource xaResource)
          Creates an endpoint with the associated XA resource.
 MessageEndpoint createEndpoint(XAResource xaResource, long timeout)
          Creates an endpoint with the associated XA resource.
 void destroy()
          Cleans up the entity server nicely.
 AbstractContext getContext(java.lang.Object obj, boolean foo)
          Returns the context with the given key
 java.util.ArrayList<AnnotatedType<? super X>> getLocalApi()
           
<T> java.lang.Object
getLocalJndiProxy(java.lang.Class<T> api)
          Returns the local jndi proxy for the given API
<T> T
getLocalProxy(java.lang.Class<T> api)
          Returns the a new local stub for the given API
 MessageDrivenContext getMessageContext()
          Returns the message driven context
<T> T
getRemoteObject(java.lang.Class<T> api, java.lang.String protocol)
          Returns the remote skeleton for the given API
protected  java.lang.String getType()
           
 void init()
          Initialize the server
 boolean isDeliveryTransacted(java.lang.reflect.Method method)
          Returns true to find out whether message deliveries to the message endpoint will be transacted.
 void setActivationSpec(ActivationSpec activationSpec)
          Sets the activation spec
 void setResourceAdapter(ResourceAdapter ra)
          Sets the resource adapter
 boolean start()
          Starts the server.
 
Methods inherited from class com.caucho.ejb.server.AbstractEjbBeanManager
bindInjection, createInjectionTarget, destroy, destroyInstance, encodeId, error, getAnnotatedType, getClassLoader, getContext, getContext, getDeployBean, getEjbClass, getEjbContainer, getEJBName, getId, getInjectManager, getLocalBean, getMappedName, getModuleInjectManager, getModuleName, getProtocolId, getProtocolId, getRawAnnotatedType, getRemoteApi, getRemoteApiList, getServerProgram, getTimerService, getTransactionTimeout, getUserTransaction, hasRemoteObject, invalidateCache, isContainerTransaction, isDead, isDependValid, lookup, newInstance, postStart, registerInjection, setAroundInvoke, setBusinessLocal, setConfigLocation, setContainerTransaction, setEjbClass, setId, setLocation, setMappedName, setRemoteApiList, setResourceList, setServerProgram, setTransactionTimeout, timeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final java.util.logging.Logger log
Constructor Detail

MessageManager

public MessageManager(EjbManager ejbContainer,
                      java.lang.String ejbName,
                      java.lang.String moduleName,
                      AnnotatedType<X> rawAnnType,
                      AnnotatedType<X> annotatedType,
                      EjbLazyGenerator<X> lazyGenerator)
Method Detail

getType

protected java.lang.String getType()
Overrides:
getType in class AbstractEjbBeanManager<X>

setActivationSpec

public void setActivationSpec(ActivationSpec activationSpec)
Sets the activation spec


setResourceAdapter

public void setResourceAdapter(ResourceAdapter ra)
Sets the resource adapter


getLocalApi

public java.util.ArrayList<AnnotatedType<? super X>> getLocalApi()
Overrides:
getLocalApi in class AbstractEjbBeanManager<X>

init

public void init()
          throws java.lang.Exception
Initialize the server

Overrides:
init in class AbstractEjbBeanManager<X>
Throws:
java.lang.Exception

bind

public void bind()
Overrides:
bind in class AbstractEjbBeanManager<X>

createBeanGenerator

protected BeanGenerator<X> createBeanGenerator()
Creates the bean generator for the session bean.


bindContext

protected void bindContext()
Overrides:
bindContext in class AbstractEjbBeanManager<X>

start

public boolean start()
              throws java.lang.Exception
Starts the server.

Overrides:
start in class AbstractEjbBeanManager<X>
Throws:
java.lang.Exception

getMessageContext

public MessageDrivenContext getMessageContext()
Returns the message driven context


getContext

public AbstractContext getContext(java.lang.Object obj,
                                  boolean foo)
Description copied from class: AbstractEjbBeanManager
Returns the context with the given key

Specified by:
getContext in class AbstractEjbBeanManager<X>

createEndpoint

public MessageEndpoint createEndpoint(XAResource xaResource)
                               throws UnavailableException
Creates an endpoint with the associated XA resource.

Specified by:
createEndpoint in interface MessageEndpointFactory
Throws:
UnavailableException

createEndpoint

public MessageEndpoint createEndpoint(XAResource xaResource,
                                      long timeout)
                               throws UnavailableException
Creates an endpoint with the associated XA resource.

Specified by:
createEndpoint in interface MessageEndpointFactory
Throws:
UnavailableException

isDeliveryTransacted

public boolean isDeliveryTransacted(java.lang.reflect.Method method)
                             throws java.lang.NoSuchMethodException
Returns true to find out whether message deliveries to the message endpoint will be transacted. This is only a hint.

Specified by:
isDeliveryTransacted in interface MessageEndpointFactory
Throws:
java.lang.NoSuchMethodException

destroy

public void destroy()
Cleans up the entity server nicely.

Overrides:
destroy in class AbstractEjbBeanManager<X>

getLocalJndiProxy

public <T> java.lang.Object getLocalJndiProxy(java.lang.Class<T> api)
Description copied from class: AbstractEjbBeanManager
Returns the local jndi proxy for the given API

Specified by:
getLocalJndiProxy in class AbstractEjbBeanManager<X>
Parameters:
api - the bean's api to return a value for

getLocalProxy

public <T> T getLocalProxy(java.lang.Class<T> api)
Description copied from class: AbstractEjbBeanManager
Returns the a new local stub for the given API

Specified by:
getLocalProxy in class AbstractEjbBeanManager<X>
Parameters:
api - the bean's api to return a value for

getRemoteObject

public <T> T getRemoteObject(java.lang.Class<T> api,
                             java.lang.String protocol)
Description copied from class: AbstractEjbBeanManager
Returns the remote skeleton for the given API

Specified by:
getRemoteObject in class AbstractEjbBeanManager<X>
Parameters:
api - the bean's api to return a value for
protocol - the remote protocol