Package jakarta.ejb.embeddable
Class EJBContainer
- java.lang.Object
- 
- jakarta.ejb.embeddable.EJBContainer
 
- 
- All Implemented Interfaces:
- AutoCloseable
 
 public abstract class EJBContainer extends Object implements AutoCloseable Used to execute an enterprise bean application in an embeddable container.- Since:
- EJB 3.1
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringAPP_NAMEStandard property name for specifying the application name of the enterprise bean modules executing within the embeddable container.static StringMODULESStandard property name for specifying the set of modules to be initialized.static StringPROVIDERStandard property name for specifying the embeddable container implementation bootstrap class.
 - 
Constructor SummaryConstructors Constructor Description EJBContainer()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidclose()Shutdown an embeddable EJBContainer instance.static EJBContainercreateEJBContainer()Create and initialize an embeddable enterprise bean container.static EJBContainercreateEJBContainer(Map<?,?> properties)Create and initialize an embeddable enterprise bean container with a set of configuration properties.abstract ContextgetContext()Retrieve a naming context for looking up references to session beans executing in the embeddable container.
 
- 
- 
- 
Field Detail- 
PROVIDERpublic static final String PROVIDER Standard property name for specifying the embeddable container implementation bootstrap class. Property value is a fully-qualified class name.- See Also:
- Constant Field Values
 
 - 
MODULESpublic static final String MODULES Standard property name for specifying the set of modules to be initialized. Property value is one of the following :- a single module name String from the JVM classpath
- a String[] array of module names from the JVM classpath
- a java.io.File representing an ejb-jar or exploded ejb-jar directory
- a java.io.File array, each element of which represents an ejb-jar or exploded ejb-jar directory
 - See Also:
- Constant Field Values
 
 - 
APP_NAMEpublic static final String APP_NAME Standard property name for specifying the application name of the enterprise bean modules executing within the embeddable container. If specified, the property value applies to the<app-name>portion of the portable global JNDI name syntax. If this property is not specified, the<app-name>portion of the portable global JNDI name syntax does not apply.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
createEJBContainerpublic static EJBContainer createEJBContainer() Create and initialize an embeddable enterprise bean container. JVM classpath is searched for all ejb-jars or exploded ejb-jars in directory format.- Returns:
- EJBContainer instance
- Throws:
- EJBException- Thrown if the container or application could not be successfully initialized.
 
 - 
createEJBContainerpublic static EJBContainer createEJBContainer(Map<?,?> properties) Create and initialize an embeddable enterprise bean container with a set of configuration properties.- Parameters:
- properties- Spec-defined and/or vendor-specific properties. The spec reserves the prefix- "jakarta.ejb."for spec-defined properties.
- Returns:
- EJBContainer instance
- Throws:
- EJBException- Thrown if the container or application could not be successfully initialized.
 
 - 
getContextpublic abstract Context getContext() Retrieve a naming context for looking up references to session beans executing in the embeddable container.- Returns:
- naming context
 
 - 
closepublic abstract void close() Shutdown an embeddable EJBContainer instance. Embeddable applications should always callclose()in order to free up the resources associated with the embeddable container.- Specified by:
- closein interface- AutoCloseable
 
 
- 
 
-