Triumphantly the Java EE Learning Notes (iii) components and roles components and roles

Source: Internet
Author: User
Tags contains continue extend functions interface variables terminates access
j2ee| notes
Learn some Java EE every week, make some notes.

Goal: Be proficient in using WebSphere to do Java EE development work.

Come on! Come on!! Come on!!!

1. Structure

1 Component: An application-level software unit J2SE owns JAVABEANS;J2EE EJB (Enterprise JavaBeans) 2 system-level entity containers provide: Run support, lifecycle management, security, deployment, thread 3 apple T and client application client components perform their own Java Virtual machine (JVM) 4 Web Components: Software entities, response requests typically provide a user interface for web-based applications Java EE two components: Servlets javaserve R Pages (JSP)

2. Web Components

1 The ability of the Servlet to extend the Web server to receive client requests and return dynamic results to the client is usually rendered as HTML or XML document 2) JavaServer Pages (JSP) provides the client with dynamic       State content text-based Document processing request Establishment response contains: template data that formats Web documents generates dynamic content for Web documents JSP elements and Small script 3 Web Components are included in the container Different types of containers: Servelet supports HTTP JSP web containers to access the Java EE Service and interacts with API services

3. Enterprise JavaBeans (EJB) architecture

1 server-side technology develops and deploys business logic components for enterprise application systems, and is a component of enterprise-class applications based on distributed transaction processing. 2 The two types of enterprises beans:session Beans and Entity Beans 3) session Beans sessions are serviced for clients, usually in single client/server mode. Beans: Complete Computing, accessing the database through the client may be a business action if its container crashes, session beans is not repairable 4 Entity beans Entity Beans provides an object view of the data in the database Entity beans data is generally stored as follows: Rational database management system; the old data entity in the mainframe beans can live with the data it represents.    If no longer used, the entity beans is recognized by the primary key if its container crashes, the entity beans (including primary key and remote reference) can be repaired, and when the server restarts, the information stored by the entity beans is placed in the new container. 5 EJB component Container Supervisor Enterprise Beans provides business and persistent services to provide access to the Java service, and the way to interact with APIs

4. The role of Java EE

    1 Role is unique      2) an organization can match its own specific environment with a slight change of role     3 the role is:       Java EE product Provider (Java EE product provider)       application Component Provider (application Component Provider)       application Assembler (application assembler)       Deployer (deployer)       system administrator (System administrator)       Tool Provider (tool provider)     4) Java EE product provider      Typical IT products provider        run Java-EE products by providing the following services:          component Container     The api         of       Java platform Other features already defined in the Java EE statement: not clearly defined in the Java EE statement, it product providers can use this to extend their products     5 application Component provider       provides:          HTML text designer      &nbsCode Editor for p;    programming          EJB Development        This role uses certain tools to create Java EE applications and components          This role is to develop the Java EE platform, Or on the Java platform to do enterprise application development of the key.

5. System administrator

    6 The application assembler       assembles the application components into a complete Java EE application by assembling the components        is passed in the form of an enterprise archive (. Ear suffix)       provides assembly instructions for deployment of an enterprise application: An additional description for the application           SQL file placement          related database scripts to execute           build a table or database     7) Deployer       Expert       in a particular operating environment is responsible for:          deployment Web Applications           deployment ejb      Deployment process is typically a level three process           installation          configuration for enterprise applications           Executive     8 system administrator is responsible for       configuration and management of enterprise data Computing and network construction       overseeing the deployment of Java EE Application Runtime scenarios       may require some specialized run-time monitoring and managementTools to complete the task

6. Tool Provider (tool provider): Provides tools for deployment and packaging of application components

Divided into two separate platform tools: Platform tools that can be used for all development environments: deployment, management, and monitoring of applications, and must be aware that such tools are dedicated to an environment, and that the limitations of each particular role

※ no need to spend too much time on the Java EE Product Provider and tool provider roles

The following content is reproduced:

EJB Architecture: The distributed application at the top of the EJB is based on the object component model, and the low-level transaction services use API technology. EJB Technology simplifies the development, configuration, and execution of enterprise application systems written in the Java language. The architecture specification of the EJB is developed by Sun Microsystems Company.   The Inprise EJB container is based on the 1.1 version of the specification. EJB Technology defines a reusable set of components: Enterprise Beans. You can use these components to build your distributed application like a building block. When you write the code, the components are grouped into specific files. Each file has one or more enterprise Beans, plus some configuration parameters. Finally, these enterprise beans are configured on a platform loaded with EJB containers. Customers can navigate to a beans through these beans home interfaces and produce an instance of this beans.   This allows the customer to invoke the beans application method and the remote interface. EJB servers manage EJB containers and functions as a bridge between containers and low-level platforms. It provides the EJB container with the ability to access system services.   For example: Database management and transaction management, or for other enterprise application servers. All EJB instances are running in the EJB container. The container provides a system-level service that controls the lifecycle of the EJB. Because the container master most of the system-level issues (hehe, do not know how to translate). Enterprise Beans developers do not need to apply logic to consider coming in.   Typically, the EJB container has the following system-level issues. 1. The security--configuration descriptor (the deployment descriptor) defines the different application functions that customers can access.   The container achieves this effect by allowing only authorized clients to access these functions. 2. Remote connectivity--container manages low-level communication issues for long-distance links, and Enterprise Beas developers and customers are hiding communications issues.enterprise beans developers are writing application methods , like a local platform on a bar.   Customers are also not aware that the method they are calling may be handled remotely. 3, Life Cycle managment--customers simply create an instance of a enterprise beans, and usually cancel an instance. The container manages the instance of enterprise beans, enabling the enterprise beans to achieve maximum performance and memory utilization. The container is able to activate andGo live Enterprise Beans, keep a pool of instances shared by many customers.   Wait a minute. 4. The trasction management-configuration descriptor defines the requirements for enterprise Beans transaction processing. The container manages the complex issues that manage distributed transaction processing. These transactions may have to update the database between different platforms. Containers make these transactions independent of each other and do not interfere with each other. Ensure that all update databases are successful, or that they are rolled back to the state before transaction processing. Enterprise Beans Component: Enterprise Beans is a component of an enterprise-class application based on distributed transaction processing. All Enterprise beans have the following characteristics: Enterprise beans contains the application logic for processing enterprise data. The Enterprise beans provider defines the Enterprise Beans Client interface (Enterprise beans remote interface). Such an interface is not affected by containers and servers. As a result, when a enterprise beans is assembled into an application, there is no need to change the code and recompile. Enterprise beans can be customized for a variety of system-level services, such as security and transaction processing, and are not part of the Enterprise beans class. It is implemented by the tools that configure and assemble the application. There are two types of enterprise beans:session beans and entity beans. (There is also a message driven bean, which is not discussed here for the moment) Session beans:session Beans is an object that is executed as a single client. As appropriate for the remote task request, the container produces an instance of the session beans. A session beans has a client. To some extent, a sessions bean represents its client for the server.   Session beans can also be used for transactions that update shared data, but it does not directly depict these shared data. The life cycle of the session beans is relatively short. Typically, the session beans is alive only when the client keeps the conversation. Once the client exits, the session beans is no longer associated with the client. The session beans is considered instantaneous, because if the container crashes, then the client must re-establish aA new Session object to continue the conversation. A session bean typically declares interoperability or conversation with the client. In other words, the session bean has the client's information in the process of invoking the method during the customer conversation.   A session bean that has a state is called a stateful session bean. When the client terminates the interaction with the sessions beans. The conversation terminates, and the bean no longer owns the state value. A session bean may also be a stateless session bean. Stateless session beans does not grasp the information or status of its customers. The client is able to invoke the beans method to complete some operations. However, beans only knows the client's argument variables when the method is invoked. When the method call completes, beans does not continue to hold these parameter variables. In this way, all instances of the stateless session beans are the same, unless it is in a method call. In this way, stateless session beans can support multiple client. A container can declare a stateless session beans. The ability to assign any session beans to any client. Entity beans:entity Beans provides an object view of the data in the database. For example, a entity bean can simulate a row of related data in a database table. Multiple client can share access to the same entity bean. Multiple client can also access the same entity bean at the same time. Entity beans accesses or updates the underlying data through the context of the transaction.   In this way, the integrity of the data can be guaranteed. Entity beans can survive relative to the duration of the teachings, and the state is continuous. As long as the data in the database exists, Entity beans is still alive. Rather than according to the application or service process. Even if the EJB container crashes, Entity beans is alive. The Entity beans lifecycle can be managed by the container or beans itself. If the container is controlled by the Entity beans to ensure the continuous issus.   If managed by beans, you must write entity beans code, including calls to access the database. Entity beans is identified by a primary key (a unique object identifier of the primary key). Typically, primary keys are the same as the primary keys that identify a single piece of data in a database, such as a row in a table. The primary key is that the client can locate a specificData blocks. The EJB ROLES:EJB architecture makes it easy to develop complex application systems by dividing the programming process into 6 different roles. 6 different roles, each with a specific task. 6 roles include downlevel services, application development, configuration and operational instructions (issues) EJB architecture simplifies the work of application developers. In the EJB architecture, the container and proxy services assume a lot of the work done by the program designers in other environments. Such agents provide a number of system-level services that originally required program designers to write code. Infrastructure roles (lower construction role) EJB Server Providor service provider is a typical proxy that provides distributed low-level services. The EJB service provider provides the platform and facilities that a distributed application developer needs.   also provides a run-time environment for distributed programs.   EJB Container Providor container providers are distributed systems, transaction processing, security-related expert container providers provide an EJB configuration tool, and run-time support for these configuration instances. A container is a run-time system for one or more ejbs. It glues enterprise beans and EJB services, including transaction services, security services, and distributed network management. A container is a tool that is both a custom code and produces detailed code for a particular Enterprise beans. The container also provides a tool for configuring Enterprisebeans and a way to manage monitoring applications.

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.