In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about what is J2EE. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
J2EE Java2 platform Enterprise Edition (Java2 Platform,Enterprise Edition)
J2EE is a set of technical architecture which is completely different from the traditional application development, including many components, which can simplify and standardize the development and deployment of the application system, and then improve the portability, security and reuse value.
The core of J2EE is a set of technical specifications and guidelines, including various components, service architecture and technical levels, all have common standards and specifications, so that there is a good compatibility between different platforms that follow the J2EE architecture, and solve the dilemma that the information products used in the back end of the enterprise are not compatible with each other, resulting in difficult communication within or outside the enterprise.
Under the J2EE architecture, developers can follow the normative basis to develop enterprise applications, while different J2EE suppliers will support the standards developed in different J2EE versions to ensure the compatibility between different J2EE platforms and products. In other words, the application system based on J2EE architecture can basically be deployed on different application servers, which can greatly improve the portability of the application system (Portability) without or only a small amount of code modification.
J2EE is a technical specification drawn up by Shengyang and IBM and other manufacturers in cooperation with the industry, and it is a JAVA development environment oriented by the operation between enterprises. The J2EE architecture defines various types of components, such as Web Component, EJB Component... And so on, and all kinds of components can be reused (reuse), so that the developed components, or the components purchased from the market, can be further assembled into different systems.
For developers, they only need to focus on the business logic and architecture design of various application systems. As for the tedious programming work at the bottom, they can be matched with different development platforms to greatly improve the efficiency of application development and deployment.
The core specification of J2EE is Enterprise Java Beans (EJBs). EJB is currently divided into three types according to its characteristics, namely, Session Bean, Entity Bean, and Message Driven Bean. Among them, Session Bean and Entity Bean are the ancestors of EJB. These two EJB specifications already existed when EJB 1.x was released, while Message Driven Bean appeared in the EJB 2.0 specification.
At present, many programmers in the industry, or web designers, take advantage of the convenience of JSP/Servlet to develop related applications on J2EE servers or integrate various resources within the company.
According to the different application fields, Java 2 platform is divided into three major versions, namely J2EE, standard version J2SE (Java 2 Platform, Standard Edition), micro version J2ME (Java 2 Platform, Micro Edition), and Java Card.
So what exactly is J2EE? Generally speaking, J2EE is a de facto industrial standard that uses Java technology to develop enterprise applications (Sun has not brought Java and its related technologies into the system of standardization organizations out of its own interests). It is the product of Java technology in the process of constantly adapting and promoting enterprise applications. At present, there are three versions of the Java platform: J2ME (Java 2 Platform Micro Edition) for small devices and smart cards, J2SE for desktop systems, and J2EE for enterprise applications. The purpose of Sun to launch J2EE is to overcome the disadvantages of traditional Client/Server model, cater to the trend of Browser/Server architecture, and provide a platform-independent, portable, multi-user, secure and standards-based enterprise platform for Java technology to develop server-side applications, so as to simplify the development, management and deployment of enterprise applications. J2EE is a standard, not an off-the-shelf product. Each platform developer develops different J2EE application servers according to J2EE specification. J2EE application server is the deployment platform of J2EE enterprise applications. Because they all follow the J2EE specification, enterprise applications developed using J2EE technology can be deployed on a variety of J2EE application servers.
In order to promote and standardize the use of J2EE architecture for enterprise applications, Sun also gives a suggested J2EE application design model: J2EE Blueprints. J2EE Blueprints provides the architecture, design patterns and related codes for implementing J2EE enterprise applications. By applying the architecture model described by J2EE Blueprints, the complex task of building enterprise applications can be partially simplified. J2EE Blueprints is the basic principle for developers to design and optimize J2EE components. At the same time, it provides a guiding strategy for the division of functions around the development work, in order to help application developers allocate technical resources reasonably.
Next, we refer to J2EE Blueprints, combined with the latest version of J2EE specification (J2EE 1.4), to explain how to use J2EE architecture for enterprise applications as a whole.
Figure 2 Architecture of enterprise applications using J2EE architecture
Figure 2 shows the architecture of an enterprise application using the J2EE architecture. J2EE incorporates different parts of a complete enterprise application into different containers (Container). Each container contains several components (which need to be deployed in the corresponding container), and various components can use a variety of J2EE Service/API. J2EE containers include:
◆ Web container server-side container, including two components JSP and Servlet,JSP and Servlet are functional extensions of Web server, accept Web requests and return dynamic Web pages. The components in the Web container can use the components in the EJB container to complete complex business logic.
◆ EJB container server-side container, which contains EJB (Enterprise JavaBeans), is one of the cores of J2EE and is mainly used for the implementation of server-side business logic. The EJB specification defines a framework for developing and deploying distributed business logic to simplify the development of enterprise applications and make it easier to have scalability, portability, distributed transaction processing, multi-user and security.
The ◆ Applet container client container, which contains a component of Applet. Applet is a lightweight client embedded in a browser and is generally used only when using Web pages does not adequately represent the data or application interface. Applet is an alternative to Web pages, and we can only use J2SE to develop various Service and API that Applet,Applet cannot use J2EE, for security reasons.
The ◆ Application Client container client container, which contains a component of Application Client. Application Client is a heavier client than Applet, and it can use most of J2EE's Service and API.
Through these four containers, J2EE can flexibly implement the architecture of enterprise applications described above.
In the View part, J2EE provides three means: JSP (or Servlet), Applet and Application Client in the Web container, which can realize browser-oriented data representation and desktop application-oriented data representation respectively. The Servlet in the Web container is the main means to realize the business process control of the Controller part, while the EJB mainly aims at the business logic implementation of the Model part. As for connecting with a variety of enterprise resources and enterprise applications, it depends on various services of J2EE and API.
Among the various services and API of J2EE, JDBC and JCA are used for the connection of enterprise resources (various enterprise information systems and databases, etc.), while JAX-RPC, JAXR and SAAJ are the basic support for Web Services and Web Services connections.
Various components of J2EE
We will elaborate on the various components, services and API of J2EE in more detail to see how to flexibly use and combine different components and services according to their needs and goals when developing different types of enterprise applications.
Servlet
Servlet is a CGI technology on the Java platform. Servlet runs on the server side to generate Web pages dynamically. Compared with traditional CGI and many other CGI-like technologies, Java Servlet is more efficient and easier to use. For Servlet, repeated requests do not result in multiple reprints of the same program, but rely on threads to support concurrent access.
JSP
JSP (Java Server Page) is a technology to realize the mixed coding of ordinary static HTML and dynamic page output. From this point of view, it is very similar to Microsoft ASP, PHP and other technologies. With the separation of formal content and appearance, the task of making Web pages can be easily divided between page designers and programmers, and can be easily synthesized through JSP. In the runtime, JSP will be first converted to Servlet and compiled and run in the form of Servlet, so its efficiency and function are no different from those of Servlet, and it is also very efficient.
EJB
EJB defines a set of reusable components: Enterprise Beans. Developers can use these components to build distributed applications like building blocks. When assembling components, all Enterprise Beans needs to be configured into EJB servers (general J2EE application servers such as Weblogic, WebSphere and so on are EJB servers). The EJB server manages the EJB container as a bridge between the container and the low-level platform, and provides the container with the ability to access system services. All EJB instances run in the EJB container. The EJB container provides system-level services that control the life cycle of EJB. The EJB container hosts technical aspects such as security, remote connectivity, lifecycle management, and transaction management for its developers, simplifying the development of business logic. Three kinds of Enterprise Beans are defined in EJB:
◆ Session Beans
◆ Entity Beans
◆ Message-driven Beans
JDBC
JDBC (Java Database Connectivity,Java Database connection) API is a standard SQL (Structured Query Language, structured query language) database access interface, which enables database developers to write database applications using standard Java API. JDBC API is mainly used to connect to the database and directly call SQL commands to execute various SQL statements. Using JDBC API, you can execute general SQL statements, dynamic SQL statements and stored procedures with IN and OUT parameters. JDBC in Java is equivalent to ODBC (Open Database Connectivity) in Microsoft platform.
JMS
JMS (Java Message Service,Java message Service) is a set of Java application interfaces that provide services for creating, sending, receiving and reading messages. JMS API defines a set of common application program interfaces and corresponding syntax, which enables Java applications to communicate with a variety of messaging middleware, including IBM MQ-Series, Microsoft MSMQ and pure Java SonicMQ. By using JMS API, developers do not need to know how to use different messaging products, but can also use a unified JMS API to manipulate a variety of messaging middleware. Through the use of JMS, you can maximize the portability of messaging applications. JMS supports both point-to-point and publish / subscribe message communication.
JNDI
Because J2EE application components are generally distributed on different machines, a mechanism is needed to make it easy for component consumers to find and reference components and resources. In J2EE system, JNDI (Java Naming and Directory Interface) is used to locate all kinds of objects, including EJB, database driver, JDBC data source and message connection, etc. JNDI API provides a unified interface for applications to perform standard directory operations, such as finding and locating objects through object properties. Because JNDI is independent of directory protocol, applications can also use JNDI to access a variety of specific directory services, such as LDAP, NDS, DNS and so on.
JTA
JTA (Java Transaction API) provides a standard interface for dealing with transactions in J2EE, which supports the start, rollback, and commit of transactions. At the same time, on the general J2EE platform, a JTS (Java Transaction Service) is always provided as a standard transaction service, and developers can use JTA to use JTS.
JCA
JCA (J2EE Connector Architecture) is a part of J2EE architecture, which provides developers with a set of architecture to connect various enterprise information systems (EIS, including ERP, SCM, CRM, etc.). For EIS developers, they only need to develop a set of JCA-based EIS connection adapter, developers can connect and use it in any J2EE application server. The implementation of connection adapter based on JCA needs to involve service components such as transaction management, security management and connection management in J2EE.
JMX
The predecessor of JMX (Java Management Extensions) is JMAPI. JMX is committed to solving the problem of distributed system management. JMX is a collection of application programming interfaces, extensible objects and methods, which can span a variety of heterogeneous operating system platforms, system architectures and network transport protocols to develop seamlessly integrated system, network and service-oriented management applications. JMX is a complete network management application development environment, which also provides complete feature list that manufacturers need to collect, resource list table can be generated, graphical user interface, remote procedure calls between network API; hosts accessing SNMP, database access methods, etc.
JAAS
JAAS (Java Authentication and Authorization Service) implements a Java version of the standard Pluggable Authentication Module (PAM) framework. JAAS can be used to authenticate users so that they can reliably and securely determine who is executing Java code. At the same time, JAAS can also realize user-based access control by authorizing users.
JACC
JACC (Java Authorization Service Provider Contract for Containers) defines a connection agreement between the J2EE application server and the specific authorization server in order to insert various authorization servers into the J2EE product.
JAX-RPC
By using JAX-RPC (Java API for XML-based RPC), existing Java classes or Java applications can be repackaged and released as Web Services. JAX-RPC provides API to encode and decode the RPC parameter (in/out), making it easy for developers to use SOAP messages to make RPC calls. Similarly, for commercial applications that use EJB (Enterprise JavaBeans), JAX-RPC can also be used to package Web services, and the WSDL interface of this Web Servoce is consistent with the original EJB approach. JAX-RPC wraps the deployment and implementation of Web services for users, and SOAP/WSDL becomes transparent to Web service developers, which helps to accelerate the development cycle of Web services.
JAXR
JAXR (Java API for XML Registries) provides an API that interacts with multiple types of registration services. JAXR runs the client to access the Web Servcices that is compatible with the JAXR specification, where Web Services is the registration service. Generally speaking, registration services always run in the form of Web Services. JAXR supports three types of registration services: JAXR Pluggable Provider, Registry-specific JAXR Provider, JAXR Bridge Provider (UDDI Registry, ebXML Registry/Repository, etc.).
SAAJ
SAAJ (SOAP with Attachemnts API for Java) is an enhancement of JAX-RPC that provides support for low-level SOAP message manipulation.
Enterprise application exampl
Let's understand the application of various components and services by assuming a J2EE implementation of an enterprise application. Suppose the application object is the sales system of the manufacturer / retailer of computer products, which can publish product information through its own website and transmit the product catalogue to the computer product market at the same time. The sales system can accept orders online (from its own Web website or from the computer product market), and then transfer to the internal enterprise management system for related follow-up processing.
Referring to figure 3, this enterprise application can be structured in this way. The core of the enterprise application is product catalogue management and product order management, which are implemented by EJB and deployed in the EJB container. Since both catalog and order information need to be persisted, JDBC is used to connect to the database and JTA is used to complete the database access transaction.
Figure 3 example of J2EE application
Then use JSP/Servlet to achieve the Web performance of the application: online product catalog browsing and online ordering. In order to send the product catalog to a specific market, JMS is used to implement asynchronous message-based product catalog transfer. In order to enable more external markets to integrate product catalogue and order business, it is necessary to use Web Services technology to package the implementation of business logic. As product order management needs to be handled by internal employees, it is necessary to integrate internal user systems and access control services to facilitate employees, use JACC to integrate internal access control services, use JNDI to integrate internal user directories, and use JAAS for access control. As the product ordering transaction will trigger the related operations of the subsequent enterprise ERP system (including warehousing, finance, production, etc.), it is necessary to use JCA to connect to the enterprise ERP.
Finally, in order to integrate this application into the overall system management system of the enterprise, a management client is constructed using Application Client (deployed on a machine with other enterprise application management applications), and the enterprise application is managed through JMX.
The above is the editor for you to share what is J2EE, if you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.