|
|
|
---|---|
Enterprise JavaBeans (EJB) | EJB technology provides a simple mechanism for creating distributed business logic components. EJB authors follow a simple pattern to write business logic and the rest of the low-level details relating to lifecycle, distribution, persistence, and so on are handled automatically. |
Java Message Service (JMS) | JMS provides asynchronous messaging capability to J2EE applications. |
Java Naming and Directory Service (JNDI) | JNDI enables J2EE applications to communicate with registries and directories. A registry/directory is a centralized location for storing business information. JNDI supports the industry standard LDAP protocol and interfaces with many other popular registry standards. JNDI makes it possible to centralize the configuration of a distributed system. |
Servlets | As explained earlier in this chapter, servlets work with special servers called servlet containers to process HTTP requests and send HTTP responses. Servlets often work directly with EJBs. |
JavaServer Pages (JSP) | JSP technology is an alternative, HTML-like interface for creating servlets. At runtime, the servlet container converts a JSP into a servlet. |
Java Transaction API (JTA) | JTA enables a web application to gracefully handle failures in one or more of its components by establishing transactions. During a transaction, multiple events can occur, and if any one of them fails, the state of the application can be rolled back to how it was before the transaction began. This technology provides the robustness of relational database transactional technology across an entire distributed application. |
CORBA | CORBA technology in Java enables J2EE web applications to communicate with distributed components written in other languages that support the language-independent CORBA standard. |
JDBC | JDBC enables Java programs to communicate with relational databases. |
Connector | The Connector API enables Java programs to create an abstraction layer for connecting with legacy systems that don't implement other J2EE-supported technologies. |
JavaMail | JavaMail provides the ability to send and receive e-mail via the industry standard POP/SMTP/IMAP protocols. |
Java XML Parser (JAXP) | JAXP gives J2EE applications the ability to speak XML. |
Note that the J2EE APIs are not designed to help developers write their own server software. Rather, they are to designed to work with a special kind of server, called a J2EE application server (app server). J2EE app servers are available on many operating systems, including Windows, Linux, Solaris, and Mac OS X. To be considered an official J2EE app server, the app server vendor must show that the app server complies with the J2EE standards and then purchase a J2EE license. Such vendors are referred to as J2EE licensees.
Agree On Standards, Compete On Implementation
If developers follow the J2EE standards, they can use a compliant, licensed J2EE app server from any vendor and it is guaranteed to work with their application. This flexibility is intended to help companies avoid vendor lock-in problems, and thus they can enjoy the benefits of a competitive marketplace. The Java slogan along these lines is "Agree on standards, compete on implementation," meaning that the vendors all cooperate on establishing universal J2EE standards and then work hard to create the best app server that supports those standards.
Pick and Choose
However, not all developers want to create the kinds of distributed systems that the entire collection of J2EE APIs are designed to support. Fortunately, it is possible to pick and choose those APIs that are necessary for your projects. For example, if all you need to do is write a GUI LDAP client, the JNDI API is the only J2EE API you'll need to use.
If you want to create a dynamic web site but don't need the additional J2EE APIs, the Servlet and JSP APIs may be all you'll want. As was mentioned earlier in this chapter, a servlet plugs in to a special server called a servlet container (and JSP is an alternative way of writing a servlet). The J2EE app server contains a servlet container, but if all you want to is write servlets/JSP, then you don't need the full app server - you just need a servlet container.
Tomcat is just such a servlet container. As a servlet container, Tomcat is only required to implement the Servlet and JSP APIs, and thus is not considered a J2EE app server. However, as J2EE app servers must themselves contain a servlet container to support the servlet/JSP APIs, J2EE app servers can embed Tomcat into their code to provide support for the Servlet and JSP APIs. One example of just such an application server is the popular open source JBoss J2EE app server (http://www.jboss.org/).
For more information on J2EE and its various APIs, visit http://java.sun.com/j2ee/.
No comments:
Post a Comment