Java Reference
In-Depth Information
aged up your SE application in a JAR file named bidservice-client.jar. Using Sun Microsys-
tems's GlassFish application server, you could launch your SE application inside the ACC
as follows:
appclient -client bidservice-client.jar
You'll need to consult the documentation for your EE server to get the details on using its
5.2.12. Embedded containers
Although the Java EE specification is intended for an Enterprise application running inside
of an EE server, not all applications are intended to run that way. Nevertheless, most ap-
plications will need common services like DI and container-managed transactions, which
EE servers happen to provide. This is where embedded containers come in. An embedded
container is an in-memory EJB container that an SE application (or unit tests) can start and
run within its own JVM. The SE application can then take advantage of most of the power
and convenience provided by EJBs.
You may think the ACC and embedded containers are the same, but they're quite different.
An ACC is all about an SE application connecting to a remote EE server to gain access
to its resources, so all of the resources are remote. For an embedded container, all of the
resources are local because the SE application starts its own in-memory EJB container and
becomes its own little EE server.
Creating an embedded container
The javax.ejb.embeddable.EJBContainer is an abstract class that EE servers
may choose to implement—it's not a requirement. A static method bootstraps its creation:
EJBContainer ec = EJBContainer.createEJBContainer();
An SE application may then use EJBContainer to interact with the EJB container.
The SE may perform operations such as lookups to get EJB instances. Table 5.8 defines
EJBContainer 's methods.
Search WWH ::

Custom Search