|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openejb.OpenEJB
public final class OpenEJB
OpenEJB is the main factory for bootstrapping and obtaining a references to the ContainerSystem. The properties used in the static init( ) method this class determines the characteristics of the ContainerSystem assembled at run time.
An OpenEJB container system is assembled at runtime by the application server according to the properties passed into the static init( ) method. Properties determine the Assembler used to assemble the ContainerSystem as well as the source configuration data used by the Assembler. A set of standard environment property names are defined in the org.openejb.EnvProps class.
Below is an example of how an application server would initialize and use this class to assemble and obtain an ContainerSystem.
Properties initProps = new Properites(); initProps.setProperty(EnvProps.ASSEMBLER,"org.openejb.core.conf.Assembler"); initProps.setProperty(EnvProps.CONFIGURATION, "/openejb/bin/config/openejb.xml"); OpenEJB myEJB = OpenEJB.init(initProps);
When assembling a ContainerSystem OpenEJB will use the Assembler implementation specified in the EnvProps.ASSEMBLER property. By default the org.openejb.core.conf.Assembler is used. In addition to specifying the Assembler, developers can also specify the location configuration of the configuration file that the Assembler will use. In the case of the default Assembler the configuration property must a URI to an XML document that adheres to the OpenEJB DTD.
Custom Assembler can be created that assemble containers from different a different configuration source using a different algorithm and implementation classes. See the org.openejb.spi.Assembler interfce for more details.
Initialization properties can also be declared in the System properties. The System properties are combined with properties explicitly passed in the OpenEJB.init( )method. Properties passed into the init( ) method override System properties.
OpenEJB provides a singleton interface for the OpenEJB container system. Only one OpenEJB instance can be constructed in the lifetime of a VM process.
EnvProps
,
Assembler
,
Assembler
Constructor Summary | |
---|---|
OpenEJB()
|
Method Summary | |
---|---|
static Container[] |
containers()
Gets all the Container s in this container system. |
static DeploymentInfo[] |
deployments()
Gets the DeploymentInfo objects for all the beans deployed in all the containers in this container system. |
static ApplicationServer |
getApplicationServer()
|
static Container |
getContainer(java.lang.Object id)
Returns the Container in this container system with the specified id. |
static java.lang.ClassLoader |
getContextClassLoader()
|
static DeploymentInfo |
getDeploymentInfo(java.lang.Object id)
Gets the DeploymentInfo object for the bean with the specified deployment id. |
static java.util.Properties |
getInitProps()
This method returns a clone of the original properties used to initialize the OpenEJB class. |
static javax.naming.Context |
getJNDIContext()
Returns the global JNDI name space for the OpenEJB container system. |
static java.lang.String |
getProperty(java.lang.String property)
|
static SecurityService |
getSecurityService()
Gets the SecurityService that this container manager exposes to the Container s it manages. |
static javax.transaction.TransactionManager |
getTransactionManager()
Gets the TransactionManager that this container manager exposes to the Container s it manages. |
static void |
init(java.util.Properties props)
|
static void |
init(java.util.Properties initProps,
ApplicationServer appServer)
|
static boolean |
isInitialized()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OpenEJB()
Method Detail |
---|
public static void init(java.util.Properties props) throws OpenEJBException
OpenEJBException
public static void init(java.util.Properties initProps, ApplicationServer appServer) throws OpenEJBException
initProps
- Specifies the Assembler and other properties used to build the ContainerSystemappServer
- application server
OpenEJBException
- Thrown if a problem occurs building the ContainerSystempublic static javax.transaction.TransactionManager getTransactionManager()
TransactionManager
that this container manager exposes to the Container
s it manages.
TransactionService.getTransactionManager()
public static SecurityService getSecurityService()
SecurityService
that this container manager exposes to the Container
s it manages.
SecurityService
public static ApplicationServer getApplicationServer()
public static DeploymentInfo getDeploymentInfo(java.lang.Object id)
DeploymentInfo
object for the bean with the specified deployment id.
id
- the deployment id of the deployed bean.
DeploymentInfo
,
Container.getDeploymentInfo
,
DeploymentInfo.getDeploymentID()
public static DeploymentInfo[] deployments()
DeploymentInfo
objects for all the beans deployed in all the containers in this container system.
DeploymentInfo
,
Container.deployments()
public static Container getContainer(java.lang.Object id)
Container
in this container system with the specified id.
id
- the id of the Container
Container
,
Container.getContainerID()
public static Container[] containers()
Container
s in this container system.
Container
public static javax.naming.Context getJNDIContext()
public static java.util.Properties getInitProps()
public static boolean isInitialized()
public static java.lang.String getProperty(java.lang.String property)
property
- property name the value is asked for
public static java.lang.ClassLoader getContextClassLoader()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |