com.caucho.ejb.manager
Class EjbManager

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

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

Environment-based container.


Method Summary
 void addServer(AbstractEjbBeanManager<?> server)
          Adds a server.
 void classMatchEvent(EnvironmentClassLoader loader, Path root, java.lang.String className)
          Callback to note the class matches
 void configureRootPath(Path root)
          Adds a root URL
static EjbManager create()
          Returns the local container.
static EjbManager create(java.lang.ClassLoader loader)
          Returns the local container.
<T> void
createBean(AnnotatedType<T> type, InjectionTarget<T> injectionTarget)
           
 void destroy()
          Closes the container.
 void environmentBind(EnvironmentClassLoader loader)
          Handles the case where the environment is configuring
 void environmentConfigure(EnvironmentClassLoader loader)
          Handles the case where the environment is configuring
 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
 AppExceptionItem getApplicationException(java.lang.Class<?> exceptionClass)
          Returns the configuration for an application exception.
 EnvironmentClassLoader getClassLoader()
          Returns the parent loader
 EjbConfigManager getConfigManager()
          Returns the configuration manager.
static EjbManager getCurrent()
          Returns the local container.
static EjbManager getCurrent(java.lang.ClassLoader loader)
          Returns the current environment container.
 java.lang.ClassLoader getGlobalClassLoader()
           
 InjectManager getInjectManager()
           
 java.lang.ClassLoader getIntrospectionClassLoader()
          Returns the introspection class loader
 int getMessageConsumerMax()
          The consumer maximum for the container.
 EjbManager getParent()
           
 EjbProtocolManager getProtocolManager()
          Returns the protocol manager.
 int getScanPriority()
          Since EJB doesn't bytecode enhance, it's priority 1
 AbstractEjbBeanManager<?> getServerByEjbName(java.lang.String name)
           
 AppExceptionItem getSystemException(java.lang.Class<?> exceptionClass)
          Returns the configuration for a system exception.
 Path getWorkDir()
          The work directory for EJB-generated files
 void init()
           
 boolean isAutoCompile()
          true if beans should be auto-compiled
 boolean isConfiguredBean(java.lang.Class<?> beanType)
           
 boolean isRootScannable(Path root, java.lang.String packageRoot)
          Returns true if the root is a valid scannable root.
 boolean isScanMatchAnnotation(CharBuffer annotationName)
          Returns true if the string matches an annotation class.
 ScanClass scanClass(Path root, java.lang.String packageRoot, java.lang.String className, int modifiers)
          Returns the state when scanning the class
 void setAutoCompile(boolean isAutoCompile)
          true if beans should be auto-compiled
 void setGlobalClassLoader(java.lang.ClassLoader globalClassLoader)
           
 void setJmsConnectionFactory(ConnectionFactory factory)
          The JMS connection factory for the container.
 void setMessageConsumerMax(int consumerMax)
          Sets the consumer maximum for the container.
static void setScanAll()
           
 void setScannableRoots(java.util.ArrayList<Path> roots)
           
 void setWorkDir(Path workDir)
          The work directory for EJB-generated files
 void start()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static EjbManager create()
Returns the local container.


create

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


getCurrent

public static EjbManager getCurrent()
Returns the local container.


getCurrent

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


setScanAll

public static void setScanAll()

setGlobalClassLoader

public void setGlobalClassLoader(java.lang.ClassLoader globalClassLoader)

getClassLoader

public EnvironmentClassLoader getClassLoader()
Returns the parent loader


getGlobalClassLoader

public java.lang.ClassLoader getGlobalClassLoader()

getIntrospectionClassLoader

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


getConfigManager

public EjbConfigManager getConfigManager()
Returns the configuration manager.


getParent

public EjbManager getParent()

getProtocolManager

public EjbProtocolManager getProtocolManager()
Returns the protocol manager.


getInjectManager

public InjectManager getInjectManager()

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.


setMessageConsumerMax

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


getMessageConsumerMax

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


isConfiguredBean

public boolean isConfiguredBean(java.lang.Class<?> beanType)

createBean

public <T> void createBean(AnnotatedType<T> type,
                           InjectionTarget<T> injectionTarget)

addServer

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


getServerByEjbName

public AbstractEjbBeanManager<?> getServerByEjbName(java.lang.String name)

getScanPriority

public int getScanPriority()
Since EJB doesn't bytecode enhance, it's priority 1

Specified by:
getScanPriority in interface ScanListener

configureRootPath

public void configureRootPath(Path root)
Adds a root URL


setScannableRoots

public void setScannableRoots(java.util.ArrayList<Path> roots)

isRootScannable

public boolean isRootScannable(Path root,
                               java.lang.String packageRoot)
Returns true if the root is a valid scannable root.

Specified by:
isRootScannable in interface ScanListener

scanClass

public ScanClass scanClass(Path root,
                           java.lang.String packageRoot,
                           java.lang.String className,
                           int modifiers)
Description copied from interface: ScanListener
Returns the state when scanning the class

Specified by:
scanClass in interface ScanListener
Parameters:
root - the module/jar's root path
packageRoot - the virtual package root (usually for Testing)
className - the class name
modifiers - the class modifiers
Returns:
the ScanClass object

isScanMatchAnnotation

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

Specified by:
isScanMatchAnnotation 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

getSystemException

public AppExceptionItem getSystemException(java.lang.Class<?> exceptionClass)
Returns the configuration for a system exception.


getApplicationException

public AppExceptionItem getApplicationException(java.lang.Class<?> exceptionClass)
Returns the configuration for an application exception.


init

public void init()

start

public void start()
           throws ConfigException
Throws:
ConfigException

destroy

public void destroy()
Closes the container.


environmentConfigure

public void environmentConfigure(EnvironmentClassLoader loader)
Handles the case where the environment is configuring

Specified by:
environmentConfigure in interface EnvironmentListener

environmentBind

public void environmentBind(EnvironmentClassLoader loader)
Handles the case where the environment is configuring

Specified by:
environmentBind in interface EnvironmentListener

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object