Enterprise JavaBeans Components Overview Three

Source: Internet
Author: User

Enterprise JavaBeans Assembly and use

The 3rd part of this article describes the deployment process for Enterprise JavaBeans components, and deployment is not just an installation, because it usually involves code generation. The deployment also uses a special deployment descriptor file that supports parameters that control the enterprise-level bean behavior, such as whether a bean requires a transaction. This feature of the bean deployment supports the descriptive, programmatic, EJB goals of bean behavior. The 3rd part also compares the two main types of persistence, bean-managed persistence and container-managed persistence, and discusses the relationship between EJB components and CORBA. A simple three-tier EJB application is also given.

Deployment process

The Enterprise JavaBeans (EJB) component is installed in a specific process called deployment. Provides support for the deployment process by the container component. At the high level, deployment consists of the following steps:

The bean's developer creates the required class files, interface files, and control information.

The container analyzes the input file and generates the necessary classes.

The container adds the entry to the JNDI namespace that points to the local object.

The developer of the EJB component writes the Java source file for the bean, which contains the business logic method that provides functionality for the bean, and includes the Ejbcreate () method. The Bean class must also implement either the Javax.ejb.SessionBean interface or the Javax.ejb.EntityBean interface. In addition, the bean developer writes an interface file that defines an extension to the Javax.ejb.EJBHome interface and the Javax.ejb.EJBObject interface. An extension of the EJBHome interface, called the Bean's local interface, contains a creation method, and if the bean is an entity bean, it also contains a finder method. The extension of the Ejbobject interface, called the Bean's remote interface, specifies the business logic method defined in the bean itself.

The developer of the Bean provides control information consisting of deployment descriptors, environment attributes, and manifest files.

A deployment descriptor is a serialized instance of a Javax.ejb.deployment.SessionDescriptor object or Javax.ejb.deployment.EntityDescriptor object.

The ambient property is stored in a file as a key-value pair, accessible through the Java.util.Properties object.

Manifest files are required to identify enterprise-level beans and their associated files.

class files for enterprise beans, class files for these two interfaces, deployment descriptor files, environment property files, and manifest files are archived using a file format named Ejb-jar. The generated Ejb-jar file is provided to the container as input to the deployment process.

At deployment time, the container analyzes the contents of the Ejb-jar file and takes the necessary action to make the bean available. These operations include generating a new Java class that implements the local and remote interfaces of the bean, binding the local interface implementation to the JNDI namespace, generating stubs and skeleton helper classes, which are required to support RMI traffic. The container can also generate a subclass of the bean, incorporating code specific to the container, to facilitate management of the bean. Classes that are generated by a container at deployment time are typically container-specific and not as portable as the EJB component itself.

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.