Java EE 6 overview
Starting from this
lesson you’ll be learning about Java Enterprise Edition (Java EE or formerly
J2EE), which is a powerful, mature, and widely used platform for development of
distributed applications. The word enterprise here
doesn’t imply that it is only for large-scale applications.
Java EE components
are used for the development of everything from an application for a local
pizza parlor’s website running on a five-hundred-dollar computer to a
super-powerful Wall Street trading application that runs on a cluster
of hundreds of interconnected servers.
Java EE 6 is the most
current platform and the easiest to use. It was released in December 2009.
Java EE
tiers are implemented in containers. It’s easy to guess
that containers were created to contain something. In the Java EE world
containers not only contain, but also control the birth, life, and death of
Java components. For example, you don’t need to write the new statement to create a new
instance of an EJB; the container will create a pool of them based on
configuration parameters. Even on the client side, while reading about applets
you might have noticed that applets’ life cycles are controlled by the JRE,
which can be called an applet container. Basically, a container is an area
inside JVM that can support a lifecycle of certain types of Java objects, such
as applets, servlet, EJB, etc.
Containers
can take care of various functions, and one of them is thread safety. It’s
great that multiple clients can connect and make requests to the same server,
but can you be sure that a thread initiated by Mary won’t interfere with John’s
thread? An EJB container implements a
single-threaded model ensuring that each client’s request operates in a
dedicated thread. Containers may offer transactional support with Java
Transaction API (JTA) and persist data for you with Java Persistence API (JPA).
The Java
EE is a specification, and when a release is published, vendors who want to
implement it in their software products create application servers that support
this specification. Multiple vendors offer their versions of a Java EE
application server. The question is what version of the Java EE specification
they support. Currently the application servers GlassFish (Oracle) and JBoss
(Red Hat) support Java EE 6. At the time of this writing WebLogic (Oracle) and
WebSphere(IBM) are still on Java EE 5, but should offer support of the latest
specification soon.
Java EE
application servers have to support multiple containers, for example a Servlet
container and an EJB container. Some vendors prefer to create products
supporting only certain technologies defined in the Java EE specification. For
example, Tomcat (Apache), Jetty (Eclipse Foundation), and Resin (Caucho) offer
support for selected technologies (such as Servlets and JSP), which makes them
suitable for implementing web applications, but if you are planning to create
web applications based on one of these products, you’ll need to figure out what
other tools or frameworks will be needed to support transactions, the business
tier, data persistence, and more.
Servlet and EJB
containers are scalable and they take care of all multi-threading issues,
enabling you to write application code as if the application were the only
user.Java EE is a very robust, reliable, and scalable platform and you will
appreciate what its container will do for your code.
Java
EE implements dependency injection.
An object doesn’t have to reach out to get the resources
it
needs, because the container injects the resources into the object using
annotations.
Interceptors offer a
mechanism by which containers can intercept method invoked on your session
beans. When the call is intercepted you can specify additional code to be
called before or after the method is executed. For example, imagine that you
need to add logging before certain methods are called. Adding interceptors is
an easy way to do this.









No comments:
Post a Comment