org.openejb
Class OpenEJB

java.lang.Object
  extended byorg.openejb.OpenEJB

public final class OpenEJB
extends Object

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.

Since:
JDK 1.2
Version:
0.1, 3/21/2000
See Also:
org.openejb.EnvProps, org.openejb.core.conf.Assembler, Assembler

Constructor Summary
OpenEJB()
           
 
Method Summary
static Container[] containers()
          Gets all the Container s in this container system.
static ApplicationServer getApplicationServer()
           
static Properties getInitProps()
          This method returns a clone of the original properties used to initialize the OpenEJB class.
static Context getJNDIContext()
          Returns the global JNDI name space for the OpenEJB container system.
static SecurityService getSecurityService()
          Gets the SecurityService that this container manager exposes to the Container s it manages.
static TransactionManager getTransactionManager()
          Gets the TransactionManager that this container manager exposes to the Container s it manages.
static void init(Properties props)
           
static void init(Properties initProps, ApplicationServer appServer)
           
static boolean isInitialized()
           
static void setApplicationServer(ApplicationServer appServer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenEJB

public OpenEJB()
Method Detail

init

public static void init(Properties props)
                 throws OpenEJBException
Throws:
OpenEJBException

init

public static void init(Properties initProps,
                        ApplicationServer appServer)
                 throws OpenEJBException
Throws:
OpenEJBException - Thrown if a problem occurs building the ContainerSystem
Since:
JDK 1.2

getTransactionManager

public static TransactionManager getTransactionManager()
Gets the TransactionManager that this container manager exposes to the Container s it manages.

Returns:
the TransactionManager to be used by this container manager's containers when servicing beans
See Also:
"javax.transaction.TransactionManager", TransactionService.getTransactionContextManager()

getSecurityService

public static SecurityService getSecurityService()
Gets the SecurityService that this container manager exposes to the Container s it manages.

Returns:
the SecurityService to be used by this container manager's containers when servicing beans
See Also:
SecurityService

getApplicationServer

public static ApplicationServer getApplicationServer()

setApplicationServer

public static void setApplicationServer(ApplicationServer appServer)

containers

public static Container[] containers()
Gets all the Container s in this container system.

Returns:
an array of all the Containers
See Also:
Container, ContainerManager.containers()

getJNDIContext

public static Context getJNDIContext()
Returns the global JNDI name space for the OpenEJB container system. The global JNDI name space contains bindings for all enterprise bean EJBHome object deployed in the entire container system. EJBHome objects are bound using their deployment-id under the java:openejb/ejb/ namespace. For example, an enterprise bean with the deployment id = 55555 would be have its EJBHome bound to the name "java:openejb/ejb/55555"

Returns:
the global JNDI context

getInitProps

public static Properties getInitProps()
This method returns a clone of the original properties used to initialize the OpenEJB class. Modifications to the clone will not affect the operations of the OpenEJB container system.


isInitialized

public static boolean isInitialized()


Copyright © 1999-2005 OpenEJB. All Rights Reserved.