com.caucho.ejb.manager
Class EjbContainer

java.lang.Object
  extended by com.caucho.ejb.manager.EjbContainer
All Implemented Interfaces:
ScanListener, EnvironmentListener

public class EjbContainer
extends java.lang.Object
implements ScanListener, EnvironmentListener

Environment-based container.


Method Summary
 void addRoot(Path root)
          Adds a root URL
 void addServer(AbstractServer server)
          Adds a server.
 void classMatchEvent(EnvironmentClassLoader loader, Path root, java.lang.String className)
          Callback to note the class matches
static EjbContainer create()
          Returns the local container.
static EjbContainer create(java.lang.ClassLoader loader)
          Returns the local container.
 AmberPersistenceUnit createEjbPersistenceUnit()
          Returns the amber persistence unit for ejb.
 void destroy()
          Closes the container.
 void environmentStart(EnvironmentClassLoader loader)
          Handles the case where the environment is starting (after init).
 void environmentStop(EnvironmentClassLoader loader)
          Handles the case where the environment is stopping
 EnvironmentClassLoader getClassLoader()
          Returns the parent loader
 java.lang.String getClientRemoteConfig()
          Returns the information for a client remote configuration, e.g.
 EjbConfigManager getConfigManager()
          Returns the configuration manager.
static EjbContainer getCurrent()
          Returns the local container.
static EjbContainer getCurrent(java.lang.ClassLoader loader)
          Returns the current environment container.
 EntityCache getEntityCache()
          Returns the entity cache.
 java.lang.ClassLoader getIntrospectionClassLoader()
          Returns the introspection class loader
 ConnectionFactory getJmsConnectionFactory()
          Sets the JMS connection factory for the container.
 int getMessageConsumerMax()
          The consumer maximum for the container.
 EjbProtocolManager getProtocolManager()
          Returns the protocol manager.
 AbstractServer getServer(Path path, java.lang.String ejbName)
          Returns the server specified by the path and ejbName, or null if not found.
 AbstractServer getServer(java.lang.String ejbName)
          Returns the server specified by the ejbName, or null if not found.
 EjbTransactionManager getTransactionManager()
          Returns the transaction manager.
 Path getWorkDir()
          The work directory for EJB-generated files
 void init()
           
 boolean isAutoCompile()
          true if beans should be auto-compiled
 boolean isRootScannable(Path root)
          Returns true if the root is a valid scannable root.
 boolean isScanMatch(CharBuffer annotationName)
          Returns true if the string matches an annotation class.
 void setAutoCompile(boolean isAutoCompile)
          true if beans should be auto-compiled
 void setJmsConnectionFactory(ConnectionFactory factory)
          The JMS connection factory for the container.
 void setMessageConsumerMax(int consumerMax)
          Sets the consumer maximum for the container.
 void setWorkDir(Path workDir)
          The work directory for EJB-generated files
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static EjbContainer create()
Returns the local container.


create

public static EjbContainer create(java.lang.ClassLoader loader)
Returns the local container.


getCurrent

public static EjbContainer getCurrent()
Returns the local container.


getCurrent

public static EjbContainer getCurrent(java.lang.ClassLoader loader)
Returns the current environment container.


getClassLoader

public EnvironmentClassLoader getClassLoader()
Returns the parent loader


getIntrospectionClassLoader

public java.lang.ClassLoader getIntrospectionClassLoader()
Returns the introspection class loader


getConfigManager

public EjbConfigManager getConfigManager()
Returns the configuration manager.


getProtocolManager

public EjbProtocolManager getProtocolManager()
Returns the protocol manager.


getTransactionManager

public EjbTransactionManager getTransactionManager()
Returns the transaction manager.


getEntityCache

public EntityCache getEntityCache()
Returns the entity cache.


createEjbPersistenceUnit

public AmberPersistenceUnit createEjbPersistenceUnit()
Returns the amber persistence unit for ejb.


setAutoCompile

public void setAutoCompile(boolean isAutoCompile)
true if beans should be auto-compiled


isAutoCompile

public boolean isAutoCompile()
true if beans should be auto-compiled


setWorkDir

public void setWorkDir(Path workDir)
The work directory for EJB-generated files


getWorkDir

public Path getWorkDir()
The work directory for EJB-generated files


setJmsConnectionFactory

public void setJmsConnectionFactory(ConnectionFactory factory)
The JMS connection factory for the container.


getJmsConnectionFactory

public ConnectionFactory getJmsConnectionFactory()
Sets the JMS connection factory for the container.


setMessageConsumerMax

public void setMessageConsumerMax(int consumerMax)
Sets the consumer maximum for the container.


getMessageConsumerMax

public int getMessageConsumerMax()
The consumer maximum for the container.


addServer

public void addServer(AbstractServer server)
Adds a server.


getServer

public AbstractServer getServer(java.lang.String ejbName)
Returns the server specified by the ejbName, or null if not found.


getServer

public AbstractServer getServer(Path path,
                                java.lang.String ejbName)
Returns the server specified by the path and ejbName, or null if not found.


getClientRemoteConfig

public java.lang.String getClientRemoteConfig()
Returns the information for a client remote configuration, e.g. the needed for the client to properly connect. Only needed for the TCK.


addRoot

public void addRoot(Path root)
Adds a root URL


isRootScannable

public boolean isRootScannable(Path root)
Returns true if the root is a valid scannable root.

Specified by:
isRootScannable in interface ScanListener

isScanMatch

public boolean isScanMatch(CharBuffer annotationName)
Description copied from interface: ScanListener
Returns true if the string matches an annotation class.

Specified by:
isScanMatch in interface ScanListener

classMatchEvent

public void classMatchEvent(EnvironmentClassLoader loader,
                            Path root,
                            java.lang.String className)
Callback to note the class matches

Specified by:
classMatchEvent in interface ScanListener

init

public void init()

start

public void start()
           throws ConfigException
Throws:
ConfigException

destroy

public void destroy()
Closes the container.


environmentStart

public void environmentStart(EnvironmentClassLoader loader)
Handles the case where the environment is starting (after init).

Specified by:
environmentStart in interface EnvironmentListener

environmentStop

public void environmentStop(EnvironmentClassLoader loader)
Handles the case where the environment is stopping

Specified by:
environmentStop in interface EnvironmentListener