com.caucho.ejb.protocol
Class EjbProtocolManager

java.lang.Object
  extended by com.caucho.ejb.protocol.EjbProtocolManager

public class EjbProtocolManager
extends java.lang.Object

Server containing all the EJBs for a given configuration.

Each protocol will extend the container to override Handle creation.


Field Summary
protected  ProtocolContainer _protocolContainer
           
protected  java.util.HashMap<java.lang.String,ProtocolContainer> _protocolMap
           
protected static java.util.logging.Logger log
           
 
Constructor Summary
EjbProtocolManager(EjbContainer ejbContainer)
          Create a server with the given prefix name.
 
Method Summary
 void addProtocolContainer(ProtocolContainer protocol)
           
 void addProtocolContainer(java.lang.String name, ProtocolContainer protocol)
           
 void addServer(AbstractServer server)
          Adds a server.
protected  HandleEncoder createHandleEncoder(AbstractServer server, java.lang.Class primaryKeyClass)
           
 HandleEncoder createHandleEncoder(AbstractServer server, java.lang.Class primaryKeyClass, java.lang.String protocolName)
           
 void destroy()
          Destroys the manager.
 EjbContainer getEjbContainer()
          Returns the EJB server.
 java.lang.String getJndiPrefix()
           
static AbstractServer getJVMServer(java.lang.String serverId)
          Returns the named server if it's in the same JVM.
 java.util.ArrayList<java.lang.String> getLocalChildren(java.lang.String ejbName)
          Returns a list of child EJB names.
 java.lang.String getLocalJndiPrefix()
           
 java.util.Iterator getLocalNames()
           
 ProtocolContainer getProtocol(java.lang.String name)
           
 java.util.ArrayList<java.lang.String> getRemoteChildren(java.lang.String ejbName)
          Returns a list of child EJB names.
 java.lang.String getRemoteJndiPrefix()
           
 AbstractServer getServerByEJBName(java.lang.String ejbName)
          Returns the server specified by the serverId.
 AbstractServer getServerByServerId(java.lang.String protocolId)
          Returns the server specified by the serverId.
static java.lang.String getThreadProtocol()
          Gets the current protocol.
 void init()
          Initialize the protocol manager.
protected  void remove(AbstractHandle handle)
          Removes an object.
 void removeProtocolContainer(ProtocolContainer protocol)
           
 void removeServer(AbstractServer server)
          Adds a server.
 void setJndiPrefix(java.lang.String name)
           
 void setLocalJndiPrefix(java.lang.String name)
           
 void setProtocolContainer(ProtocolContainer protocol)
           
 void setRemoteJndiPrefix(java.lang.String name)
           
static java.lang.String setThreadProtocol(java.lang.String protocol)
          Gets the current protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final java.util.logging.Logger log

_protocolContainer

protected ProtocolContainer _protocolContainer

_protocolMap

protected java.util.HashMap<java.lang.String,ProtocolContainer> _protocolMap
Constructor Detail

EjbProtocolManager

public EjbProtocolManager(EjbContainer ejbContainer)
                   throws ConfigException
Create a server with the given prefix name.

Throws:
ConfigException
Method Detail

setJndiPrefix

public void setJndiPrefix(java.lang.String name)

getJndiPrefix

public java.lang.String getJndiPrefix()

setLocalJndiPrefix

public void setLocalJndiPrefix(java.lang.String name)

getLocalJndiPrefix

public java.lang.String getLocalJndiPrefix()

setRemoteJndiPrefix

public void setRemoteJndiPrefix(java.lang.String name)

getRemoteJndiPrefix

public java.lang.String getRemoteJndiPrefix()

getEjbContainer

public EjbContainer getEjbContainer()
Returns the EJB server.


init

public void init()
          throws javax.naming.NamingException
Initialize the protocol manager.

Throws:
javax.naming.NamingException

getThreadProtocol

public static java.lang.String getThreadProtocol()
Gets the current protocol.


setThreadProtocol

public static java.lang.String setThreadProtocol(java.lang.String protocol)
Gets the current protocol.


setProtocolContainer

public void setProtocolContainer(ProtocolContainer protocol)

addProtocolContainer

public void addProtocolContainer(ProtocolContainer protocol)

removeProtocolContainer

public void removeProtocolContainer(ProtocolContainer protocol)

addProtocolContainer

public void addProtocolContainer(java.lang.String name,
                                 ProtocolContainer protocol)

getProtocol

public ProtocolContainer getProtocol(java.lang.String name)

getJVMServer

public static AbstractServer getJVMServer(java.lang.String serverId)
Returns the named server if it's in the same JVM.


addServer

public void addServer(AbstractServer server)
Adds a server.


removeServer

public void removeServer(AbstractServer server)
                  throws javax.naming.NamingException
Adds a server.

Throws:
javax.naming.NamingException

getServerByEJBName

public AbstractServer getServerByEJBName(java.lang.String ejbName)
Returns the server specified by the serverId.


getServerByServerId

public AbstractServer getServerByServerId(java.lang.String protocolId)
Returns the server specified by the serverId.


getLocalNames

public java.util.Iterator getLocalNames()

getLocalChildren

public java.util.ArrayList<java.lang.String> getLocalChildren(java.lang.String ejbName)
Returns a list of child EJB names.

Parameters:
ejbName - the name which might be a prefix.

getRemoteChildren

public java.util.ArrayList<java.lang.String> getRemoteChildren(java.lang.String ejbName)
Returns a list of child EJB names.

Parameters:
ejbName - the name which might be a prefix.

createHandleEncoder

public HandleEncoder createHandleEncoder(AbstractServer server,
                                         java.lang.Class primaryKeyClass,
                                         java.lang.String protocolName)
                                  throws ConfigException
Throws:
ConfigException

createHandleEncoder

protected HandleEncoder createHandleEncoder(AbstractServer server,
                                            java.lang.Class primaryKeyClass)
                                     throws ConfigException
Throws:
ConfigException

remove

protected void remove(AbstractHandle handle)
Removes an object.


destroy

public void destroy()
Destroys the manager.