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(EjbManager 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(AbstractEjbBeanManager<?> server)
          Adds a server.
 void destroy()
          Destroys the manager.
 EjbManager getEjbContainer()
          Returns the EJB server.
 java.lang.String getJndiPrefix()
           
static AbstractEjbBeanManager<?> 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()
           
 AbstractEjbBeanManager<?> getServerByEJBName(java.lang.String ejbName)
          Returns the server specified by the serverId.
 AbstractEjbBeanManager<?> 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.
 void removeProtocolContainer(ProtocolContainer protocol)
           
 void removeServer(AbstractEjbBeanManager<?> 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(EjbManager 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 EjbManager 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 AbstractEjbBeanManager<?> getJVMServer(java.lang.String serverId)
Returns the named server if it's in the same JVM.


addServer

public void addServer(AbstractEjbBeanManager<?> server)
Adds a server.


removeServer

public void removeServer(AbstractEjbBeanManager<?> server)
                  throws javax.naming.NamingException
Adds a server.

Throws:
javax.naming.NamingException

getServerByEJBName

public AbstractEjbBeanManager<?> getServerByEJBName(java.lang.String ejbName)
Returns the server specified by the serverId.


getServerByServerId

public AbstractEjbBeanManager<?> 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.

destroy

public void destroy()
Destroys the manager.