Java Reference
In-Depth Information
1.4. EJB runtimes
When you build a simple Java class, you need a Java Virtual Machine (JVM) to execute
it. In a similar way (as you learned in section 1.3 ), to execute session beans and MDBs
you need an EJB container. In this section we give you a bird's-eye view of the different
runtimes that an EJB container may contain inside.
Think of the container as an extension of the basic idea of a JVM. Just as the JVM transpar-
ently manages memory on your behalf, the container transparently provides EJB compon-
ent services such as transactions, security management, remoting, and web services sup-
port. You might even think of the container as a JVM on steroids, of which the purpose is to
execute EJB. In EJB 3, the container provides services applicable only to session beans and
MDBs. The task of putting an EJB 3 component inside a container is called deployment.
Once an EJB is successfully deployed in a container, it can be used in your applications.
In the Java world, containers aren't limited to the realm of EJB 3. You're probably familiar
with a web container, which allows you to run web-based applications using Java techno-
logies such as Servlets, JSP, and JSF. A Java EE container is an application server solution
that supports EJB 3, a web container, and other Java EE APIs and services. Oracle WebLo-
gic server, GlassFish server, IBM WebSphere application server, JBoss application server,
and Caucho Resin are examples of Java EE containers.
1.4.1. Application servers
Application servers are where EJBs have been traditionally deployed. Application servers
are Java EE containers that include support for all Java EE APIs, as well as facilities for ad-
ministration, deployment, monitoring, clustering, load balancing, security, and so on. In ad-
dition to supporting Java EE-related technologies, some application servers can also func-
tion as production-quality HTTP servers. Others support modularity via technologies like
OSGi. As of Java EE 6, application servers can also come in a scaled-down, lightweight
Web Profile form. The Web Profile is a smaller subset of Java EE APIs specifically geared
toward web applications. Web Profile APIs include JSF 2.2, CDI 1.1, EJB 3.2 Lite (dis-
cussed in section 1.4.2 ), JPA 2.1, JTA 1.2, and bean validation. At the time of writing,
GlassFish and Resin provided Java EE 7 Web Profile offerings. Note that Java EE 7 Web
Profile implementations are free to add APIs as they wish. For example, Resin adds JMS,
as well as most of the EJB API including messaging, remoting, and scheduling (but not
Search WWH ::




Custom Search