EJB.3.1 EJB Architecture Roles


The Enterprise JavaBeans architecture defines six distinct roles in the application development and deployment life cycle. Each EJB role may be performed by a different party. The EJB architecture specifies the contracts that ensure that the product of each EJB role is compatible with the product of the other EJB architecture roles. The EJB specification focuses on those contracts that are required to support the development and deployment of ISV-written enterprise beans.

Note

In some scenarios, a single party may perform several EJB architecture roles. For example, the container provider and the EJB server provider may be the same vendor. Or a single programmer may perform the two EJB architecture roles of the enterprise bean provider and the application assembler.


The following sections define the six EJB architecture roles.

EJB.3.1.1 Enterprise Bean Provider

The enterprise bean provider (bean provider for short) is the producer of enterprise beans. His or her output is an EJB JAR file that contains one or more enterprise beans. The bean provider is responsible for the Java classes that implement the enterprise bean's business methods , the definition of the bean's remote and home interfaces, and the bean's deployment descriptor. The deployment descriptor includes the structural information (e.g., the name of the enterprise bean class) of the enterprise bean and declares all the enterprise bean's external dependencies (e.g., the names and types of the resource managers that the enterprise bean uses).

The enterprise bean provider is typically an application domain expert. The bean provider develops reusable enterprise beans that typically implement business tasks or business entities.

The bean provider is not required to be an expert at system-level programming. Therefore, the bean provider usually does not program transactions, concurrency, security, distribution, or other services into the enterprise beans. The bean provider relies on the EJB container for these services.

A bean provider of multiple enterprise beans often performs the EJB architecture role of the application assembler.

EJB.3.1.2 Application Assembler

The application assembler combines enterprise beans into larger deployable application units. The input to the application assembler is one or more EJB JAR files produced by the bean provider(s). The application assembler outputs one or more EJB JAR files that contain the enterprise beans along with their application assembly instructions. The application assembler has inserted the application assembly instruction into the deployment descriptors.

The application assembler can also combine enterprise beans with other types of application components (e.g., Java ServerPages ) when composing an application.

The EJB specification describes the case in which the application assembly step occurs before the deployment of the enterprise beans. However, the EJB architecture does not preclude the case that application assembly is performed after the deployment of all or some of the enterprise beans.

The application assembler is a domain expert who composes applications that use enterprise beans. The application assembler works with the enterprise bean's deployment descriptor and the enterprise bean's client-view contract. Although the assembler must be familiar with the functionality provided by the enterprise beans' remote and home interfaces, he or she does not need to have any knowledge of the enterprise beans' implementation.

EJB.3.1.3 Deployer

The deployer takes one or more EJB JAR files produced by a bean provider or application assembler and deploys the enterprise beans contained in the EJB JAR files in a specific operational environment. The operational environment includes a specific EJB server and container.

The deployer must resolve all the external dependencies declared by the bean provider (e.g., the deployer must ensure that all resource manager connection factories used by the enterprise beans are present in the operational environment, and he or she must bind them to the resource manager connection factory references declared in the deployment descriptor), and must follow the application assembly instructions defined by the application assembler. To perform his role, the deployer uses tools provided by the EJB container provider.

The deployer's output is enterprise beans (or an assembled application that includes enterprise beans) that have been customized for the target operational environment, and that are deployed in a specific EJB container.

The deployer is an expert at a specific operational environment and is responsible for the deployment of enterprise beans. For example, the deployer is responsible for mapping the security roles defined by the application assembler to the user groups and accounts that exist in the operational environment in which the enterprise beans are deployed.

The deployer uses tools supplied by the EJB container provider to perform the deployment tasks. The deployment process is typically two-stage:

  • The deployer first generates the additional classes and interfaces that enable the container to manage the enterprise beans at runtime. These classes are container-specific.

  • The deployer performs the actual installation of the enterprise beans and the additional classes and interfaces into the EJB container.

In some cases, a qualified deployer may customize the business logic of the enterprise beans at their deployment. Such a deployer would typically use the container tools to write relatively simple application code that wraps the enterprise bean's business methods.

EJB.3.1.4 EJB Server Provider

The EJB server provider is a specialist in the area of distributed transaction management, distributed objects, and other lower-level system-level services. A typical EJB server provider is an OS vendor, middleware vendor, or database vendor.

The current EJB architecture assumes that the EJB server provider and the EJB container provider roles are the same vendor. Therefore, it does not define any interface requirements for the EJB server provider.

EJB.3.1.5 EJB Container Provider

The EJB container provider (container provider for short) provides

  • The deployment tools necessary for the deployment of enterprise beans.

  • The runtime support for the deployed enterprise beans' instances.

From the perspective of the enterprise beans, the container is a part of the target operational environment. The container runtime provides the deployed enterprise beans with transaction and security management, network distribution of clients , scalable management of resources, and other services that are generally required as part of a manageable server platform.

The "EJB container provider's responsibilities" defined by the EJB architecture are meant to be requirements for the implementation of the EJB container and server. Since the EJB specification does not architect the interface between the EJB container and server, it is left up to the vendor how to split the implementation of the required functionality between the EJB container and server.

The expertise of the container provider is system-level programming, possibly combined with some application-domain expertise. The focus of a container provider is on the development of a scalable, secure, transaction-enabled container that is integrated with an EJB server. The container provider insulates the enterprise bean from the specifics of an underlying EJB server by providing a simple, standard API between the enterprise bean and the container. This API is the Enterprise JavaBeans component contract.

For entity beans with container-managed persistence, the entity container is responsible for persistence of the entity beans installed in the container. The container provider's tools are used to generate code that moves data between the enterprise bean's instance variables and a database or an existing application.

The container provider typically provides support for versioning the installed enterprise bean components. For example, the container provider may allow enterprise bean classes to be upgraded without invalidating existing clients or losing existing enterprise bean objects.

The container provider typically provides tools that allow the system administrator to monitor and manage the container and the beans running in the container at runtime.

EJB.3.1.6 System Administrator

The system administrator is responsible for the configuration and administration of the enterprise's computing and networking infrastructure that includes the EJB server and container. The system administrator is also responsible for overseeing the well-being of the deployed enterprise beans applications at runtime.

The EJB architecture does not define the contracts for system management and administration. The system administrator typically uses runtime monitoring and management tools provided by the EJB server and container providers to accomplish these tasks.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net