com.caucho.ejb.message
Class MessageServer

java.lang.Object
  extended by com.caucho.ejb.AbstractServer
      extended by com.caucho.ejb.message.MessageServer
All Implemented Interfaces:
EnvironmentBean, MessageEndpointFactory

public class MessageServer
extends AbstractServer
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.AbstractServer
_component, _contextImplClass, _dataSource, _destroyInject, _ejbClass, _ejbContainer, _ejbName, _filename, _handleEncoder, _handleServerId, _homeHandle, _homeStubClass, _id, _initInject, _initProgram, _line, _loader, _local21, _localApiList, _localHome, _localHomeClass, _location, _mappedName, _metaData, _moduleName, _primaryKeyClass, _protocolEncoderMap, _remote21, _remoteApiList, _remoteHome, _remoteHomeClass, _remoteHomeView, _remoteObjectClass, _remoteStubClass, _serviceEndpointClass, _transactionTimeout, _ut
 
Constructor Summary
MessageServer(EjbContainer ejbContainer)
           
 
Method Summary
protected  void bindContext()
           
 MessageEndpoint createEndpoint(XAResource xaResource)
          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.lang.Object getLocalObject(java.lang.Class api)
          Returns the a new local stub for the given API
 java.lang.Object getLocalProxy(java.lang.Class api)
          Returns the local jndi proxy for the given API
 MessageDrivenContext getMessageContext()
          Returns the message driven context
 java.lang.Object getRemoteObject(java.lang.Class 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.AbstractServer
addClientRemoteConfig, addHandleEncoder, bindInjection, destroyInstance, encodeId, error, getBeanSkelClass, getClassLoader, getContext, getContext, getContext, getEjbClass, getEjbContainer, getEJBHome, getEJBLocalHome, getEJBMetaData, getEJBName, getEJBObject, getHandleEncoder, getHandleEncoder, getHandleServerId, getHomeHandle, getHomeStubClass, getId, getInitProgram, getLocalApiList, getLocalHomeClass, getMappedName, getModuleName, getPostConstruct, getPreDestroy, getPrimaryKeyClass, getProtocolId, getProtocolId, getRemote21, getRemoteApiList, getRemoteHomeClass, getRemoteObject, getRemoteObjectClass, getRemoteStubClass, getServerProgram, getServiceEndpoint, getSessionContext, getTimerService, getTransactionTimeout, getUserTransaction, hasRemoteObject, initInstance, initInstance, introspectDestroy, invalidateCache, isContainerTransaction, isDead, isLocal, isRemote, lookup, remove, remove, setAroundInvoke, setConfigLocation, setContainerTransaction, setContextImplClass, setEjbClass, setEJBName, setHandleEncoder, setId, setInitProgram, setLocalApiList, setLocalHomeClass, setLocation, setMappedName, setModuleName, setPostConstruct, setPreDestroy, setRemoteApiList, setRemoteHomeClass, setRemoteObjectClass, setServerProgram, setServiceEndpoint, setTransactionTimeout, 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

MessageServer

public MessageServer(EjbContainer ejbContainer)
Method Detail

getType

protected java.lang.String getType()
Overrides:
getType in class AbstractServer

setActivationSpec

public void setActivationSpec(ActivationSpec activationSpec)
Sets the activation spec


setResourceAdapter

public void setResourceAdapter(ResourceAdapter ra)
Sets the resource adapter


init

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

Overrides:
init in class AbstractServer
Throws:
java.lang.Exception

bindContext

protected void bindContext()
Overrides:
bindContext in class AbstractServer

start

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

Overrides:
start in class AbstractServer
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: AbstractServer
Returns the context with the given key

Specified by:
getContext in class AbstractServer

createEndpoint

public MessageEndpoint createEndpoint(XAResource xaResource)
                               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 AbstractServer

getRemoteObject

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

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

getLocalObject

public java.lang.Object getLocalObject(java.lang.Class api)
Description copied from class: AbstractServer
Returns the a new local stub for the given API

Specified by:
getLocalObject in class AbstractServer
Parameters:
api - the bean's api to return a value for

getLocalProxy

public java.lang.Object getLocalProxy(java.lang.Class api)
Description copied from class: AbstractServer
Returns the local jndi proxy for the given API

Specified by:
getLocalProxy in class AbstractServer
Parameters:
api - the bean's api to return a value for