public abstract class EJBContainer
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APP_NAME
Standard property name for specifying the application name of
the EJB modules executing within the embeddable container.
|
static java.lang.String |
MODULES
Standard property name for specifying the set of modules to be
initialized.
|
private static java.lang.String |
newLine |
static java.lang.String |
PROVIDER
Standard property name for specifying the embeddable container implementation bootstrap
class.
|
private static java.util.ServiceLoader<EJBContainerProvider> |
providers |
Constructor and Description |
---|
EJBContainer() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Shutdown an embeddable EJBContainer instance.
|
static EJBContainer |
createEJBContainer()
Create and initialize an embeddable EJB container.
|
static EJBContainer |
createEJBContainer(java.util.Map<?,?> properties)
Create and initialize an embeddable EJB container with a
set of configuration properties.
|
private static java.lang.String |
createErrorMessage(java.lang.Throwable t) |
abstract javax.naming.Context |
getContext()
Retrieve a naming context for looking up references to session beans
executing in the embeddable container.
|
private static void |
reportError(java.util.Map<?,?> properties,
java.util.Map<java.lang.String,java.lang.String> errors,
java.util.Set<java.lang.String> returnedNull)
Create a meaningful EJBException in case no EJBContainer provider had
been found.
|
public static final java.lang.String PROVIDER
public static final java.lang.String MODULES
public static final java.lang.String APP_NAME
<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.private static final java.lang.String newLine
private static final java.util.ServiceLoader<EJBContainerProvider> providers
public static EJBContainer createEJBContainer()
EJBException
- Thrown if the container or application
could not be successfully initialized.public static EJBContainer createEJBContainer(java.util.Map<?,?> properties)
properties
- Spec-defined and/or vendor-specific
properties. The spec reserves the prefix
"javax.ejb."
for spec-defined properties.EJBException
- Thrown if the container or application
could not be successfully initialized.public abstract javax.naming.Context getContext()
public abstract void close()
close()
in order to free up the resources
associated with the embeddable container.close
in interface java.lang.AutoCloseable
private static void reportError(java.util.Map<?,?> properties, java.util.Map<java.lang.String,java.lang.String> errors, java.util.Set<java.lang.String> returnedNull) throws EJBException
properties
- the properties passed as an argument to the
createEJBContainer() methoderrors
- the Map of errors encountered during the createEJBContainer() callreturnedNull
- the Set of providers that returned null on
createEJBContainer() callEJBException
private static java.lang.String createErrorMessage(java.lang.Throwable t)