"EE" understands the Java EE specification in the project

Source: Internet
Author: User
Tags apache tomcat


The Java EE platform is comprised of a suite of services (service), application interfaces (APIs), and protocols that provide functional support for developing enterprise applications. 13 Core technologies are JDBC, JNDI, EJB, RMI, JSP, SERVLET, XML, JMS, Javaidl/corba, JTS, JTA, JavaMail and JAF.

What is enterprise-class application?

1. The amount of data is particularly large.

2. The user is very much.

3. High performance requirements.

4. High security requirements.

5. Long life cycle.

At this time we have to consider the problem of data storage and query, system access speed is the performance problem, how to use transactions to ensure the security of the problem, how to make the system can be extended easy to maintain the problem. This involves the use of distributed, remote method invocation, service communication, transaction and service technologies, i.e. EJB, RMI, JNDI, JTA and so on.

The Java EE provides a framework-a standard set of interfaces for the development of distributed architecture applications, but it does not provide implementations. The meaning of the interface is to allow different vendors to completely release dependencies because they follow a common interface. For example, a flashlight that can only pack 5th batteries, Can be installed in a different brand of No. 5th Battery. With the specification of the No. 5th Battery, manufacturers of flashlights and batteries can be produced separately. After Java EE provides interfaces, third-party vendors or specific components that specialize in the entire Java EE architecture, such as Apache Tomcat, implement JSPs and Servlets, or provide a more complete implementation of the Java EE specification, such as the WebLogic of JBoss and Bea.

The Java EE contains a few types of containers:

Web container

EJB container

Applet Client Container

Application Client Container

.



So, Tomcat is actually a Web container that contains a JSP container and a servlet container. JBoss and WebLogic are web containers and EJB containers. JBoss is very hot these two years. We are already familiar with the current Itoo project on JBoss. JBoss and Java EE help us handle a number of routine programming tasks such as providing transactional services, security domains, reliable messaging, name and directory services, database access and connection pooling, thread pooling, clustering , load balancing and fault-tolerant processing.

Let's look at how technologies such as JDBC and EJB are specifically supporting our distributed applications.

Jdbcapi access to a variety of databases in a unified manner. This is a unified interface that masks the characteristics of different databases. I don't know if my friends remember the code that was originally written using JDBC, get connection and statement ... We also used a connection pool to get the connection from the connection pool and manage the connection. Our data persistence layer uses hibernate, and Hibernate is the implementation of the JPA specification. There is no mention of JPA in the 13 specifications of the preceding Java EE, which adds that the Java EE specification is not only 13, These 13 are just what people use. Just as there are more than 23 design patterns, we are only the ones that are most commonly used. The JPA encapsulates JDBC, so we use hibernate in our system without having to care about JDBC.

EJB is widely used in the Java EE specification. It provides a framework for developing and implementing distributed business logic that defines when EJB components interact with their containers. The EJB container is responsible for providing public services such as directory services, transaction management, resource buffer pools, and so on.

Jndi is used to perform name and directory services. How to understand it, it provides a consistent model to access and manipulate enterprise-level resources (DNS and LDAP), An object in the local file system or application server. The Enterprisejavabeans object instance that we wrote is running in the EJB container, and the following code example is using Jndi to find the object in the application server, where the application server is different from the local application server.

The following bean is configured in the Spring-mvc.xml file of the underlying system.


<jee:jndi-lookup id= "Institutionbean" Jndi-name= "ejb:itoo-basic-institution-ear/ Itoo-basic-institution-core-0.0.1-snapshot/institutionbean!com.tgb.itoo.basic.service.institutionbean "        ></jee:jndi-lookup>


Other systems call the interface of the underlying system remotely, using JNDI lookups to


/** * Get all Colleges */@Overridepublic list<institution> getallcolleageinfo () {Institutionbean Institutionbean = Null;try {Institutionbean = (Institutionbean) this.lookupremotebean ("itoo-basic-institution-ear/ Itoo-basic-institution-core-0.0.1-snapshot/institutionbean!com.tgb.itoo.basic.service.institutionbean ");} catch (Namingexception e) {e.printstacktrace ();} return Institutionbean.queryallcolleage ();}


The broad and profound of the Java EE is also worthy of our research, the project driver is we are more and more in-depth good model. Then we explore the greatness of EJB together.



"EE" understands the Java EE specification in the project

Related Article

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: info-contact@alibabacloud.com 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.