Java EE Comprehensive introduction (ii)

Source: Internet
Author: User
Tags connection pooling execution html page interface mail resource access perl script
Java-ee < connect to Java Overview (i) >
Four. The structure of Java EE

This component-based, platform-independent Java EE structure makes the Java EE program written very simple, because the business logic is encapsulated into reusable components, and the Java server in the form of containers for all component types to provide background services. Because you don't have to develop this service yourself, you can focus on solving the business problems at hand.

Containers and Services
The container settings customize the internal support provided by the Java server, including security, transaction Management, JNDI (Java naming and Directory Interface) addressing, remote connectivity, and other services to address the most important of these services:

The Java EE security model allows you to configure Web Components or enterprise beans so that only authorized users can access system resources. Each customer belongs to a particular role, and each role only allows specific methods to be activated. You should declare the role and the method that can be activated in the Enterprise bean's layout description. Because of this declarative approach, you do not have to write rules to enforce security.
Java EE transaction Management (Transaction Management) model lets you specify the relationships between all the methods in a transaction, so that all the methods in a transaction are treated as a single unit. When the client activates a method in a enterprise bean, the container is involved in an administrative transaction. Because of a container-managed transaction, it is not necessary to encode the bounds of the transaction in the Enterprise bean. Code that requires control over distributed transactions can be very complex. Instead of writing and debugging complex code, you simply declare the transaction attributes of the enterprise bean in the layout description file. The container will read this file and handle this enterprise bean transaction for you.
The Jndi Addressing (Jndi Lookup) service provides a unified interface to multiple names and directory services within an enterprise so that application components can access the name and directory services.
The Java EE remote client Connectivity model manages low-level interactions between clients and enterprise beans. When a enterprise bean is created, a client can call its method as if it were on the same virtual machine as the client.
The Lifecycle Management (Life Cycle Management) model manages the creation and removal of enterprise beans, and a enterprise bean will go through several states in its lifetime. The container creates the enterprise bean and moves it in the available instance pool and the active state, and eventually removes it from the container. Even if you can call the Enterprise bean's create and remove methods, the container will perform these tasks in the background.
The Database connection pool (DB Connection pooling) model is a valuable resource. Getting a database connection is a time-consuming task, and the number of connections is very limited. Containers mitigate these problems by managing connection pooling. The enterprise bean can quickly get connections from the pool. Can be used for other beans when the bean releases the connection.
Container type
The Java EE application component can be installed and deployed in the following containers:

The EJB container manages the execution of enterprise-level beans in all Java EE applications. Enterprise beans and their containers run on the Java server.
The Web container manages the execution of JSP pages and servlet components in all Java EE applications. The Web components and their containers run on the Java server.
The application client container manages the execution of application client components in all Java EE applications. The application client and their containers run on the Java server.
The Applet container is a combination of a Web browser and a Java plug-in running on the client machine.

Five. Java EE's core APIs and components

The Java EE platform consists of a suite of service (services), application interfaces (APIs), and protocols that provide functional support for the development of web-based multi-tier applications, with a simple description of the 13 technical specifications in Java EE (limited to space, only a simple description):
1. JDBC (Java Database connectivity):
The JDBC API provides a unified approach to accessing different databases, like ODBC, where JDBC masks some of the details of the developer, and JDCB access to the database is also platform-independent.
2. JNDI (Java Name and Directory Interface):
The JNDI API is used to perform name and directory services. It provides a consistent model for accessing and manipulating enterprise-class resources such as DNS and LDAP, local file systems, or objects in the application server.
3. EJB (Enterprise JavaBean):
One of the reasons why the technology of Java-EE wins a wide attention is EJB. They provide a framework for developing and implementing distributed business logic, thereby significantly simplifying the development of scalable and highly complex enterprise-class applications. The EJB specification defines when and how EJB components interact with their containers. The container is responsible for providing common services such as directory services, transaction management, security, resource buffer pooling, and fault tolerance. But it's worth noting that EJB is not the only way to achieve Java EE. It is because of the openness of Java EE that some vendors can achieve the same goal in a way that is parallel to EJB.
4. RMI (Remote method Invoke):
As its name indicates, the RMI protocol invokes methods on the remote object. It uses serialization to pass data on both the client and server side. RMI is a more low-level protocol that is used by EJBS.
5. Java Idl/corba:
With the support of Java IDL, developers can integrate Java with CORBA. They can create Java objects and enable them to expand in a CORBA orb, or they can create Java classes and serve as customers for CORBA objects that are expanded with other orb. The latter approach provides another way through which Java can be used to integrate your new application with the old system.
6. JSP (Java Server Pages):
JSP pages are made up of HTML code and embedded Java code. The server processes the Java code after the page is requested by the client, and then returns the resulting HTML page to the client's browser.
7. Java Servlet:
A servlet is a small Java program that expands the functionality of a Web server. As a server-side application, it is similar to a CGI Perl script to start executing when requested. Most of the functionality provided by the servlet is similar to the JSP, but it is implemented in a different way. JSP is typically a small amount of Java code embedded in most HTML code, while Servlets is written in Java and generates HTML.
8. XML (extensible Markup Language):
XML is a language that can be used to define other markup languages. It is used to share data in different business processes. The development of XML and Java are independent of each other, but it is the same goal with Java is platform independence. By combining Java and XML, you can get a perfect platform-independent solution.
9. JMS (Java message Service):
MS is an application interface (API) for communicating with message-oriented middleware. It supports point-to-point domains, has domains that support the Publish/subscribe (Publish/subscribe) type, and provides support for the following types: Approved messaging, transactional message delivery, consistent messaging, and persistent subscriber support. JMS also provides another way to integrate your application with the old backend system.
JTA (Java Transaction architecture):
JTA defines a standard API from which application systems can access various transaction monitoring.
JTS (Java Transaction Service):
JTS is the basic implementation of CORBA OTS transaction monitoring. JTS provides a way to implement the transaction manager. The transaction manager is the Java Transaction API (JTA) specification at the top level, and the OMG OTS specification is implemented at the lower levels of the Java image. The JTS transaction Manager provides transactional services for application servers, resource managers, stand-alone applications, and communication Explorer.
JavaMail is an API for accessing mail servers, which provides an abstract class of mail servers. Supports not only SMTP servers, but also IMAP servers.
JTA (JavaBeans activation Framework):
JavaMail uses JAF to process MIME-encoded message attachments. A MIME byte stream can be converted to a Java object or converted from a Java object. Most applications do not need to use JAF directly.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.