Chapter 20. The javax.ejb.deployment Package
The javax.ejb.deployment package defines classes used by EJB containers to encapsulate information about EJB objects. An EJB container should provide a tool that creates an instance of the EntityDescriptor or SessionDescriptor class for a bean, initializes its fields, and then serializes that initialized instance. Then, when the bean is deployed into the EJB container, the container reads the serialized deployment descriptor class and its properties to obtain configuration information for the bean. Figure 20-1 shows the class hierarchy of this package.
Figure 20-1. The javax.ejb.deployment package class hierarchy
This is a serializable class that represents a security-related entry within a bean deployment descriptor. Each AccessControlEntry included within a DeploymentDescriptor specifies a list of identities, in the form of java.security.Identity objects, that should have access to a particular method on a bean. If there is no method set for the entry, the entry is considered the default access control entry for the entire bean, listing which identities should have access to the bean. Any method on a bean without its own AccessControlEntry object uses the default entry for access control.
Passed To: DeploymentDescriptor.setAccessControlEntries()
Returned By: DeploymentDescriptor.getAccessControlEntries()
A ControlDescriptor is a component of a DeploymentDescriptor that specifies how a container should manage the transaction and security features for a specific method on a bean. If no method is specified in the ControlDescriptor, the features apply by default to all methods on the bean, unless a method has its own ControlDescriptor.
The methods on the ControlDescriptor let you specify the transaction isolation level (using the constant TRANSACTION_XXX members of the class), the identity under which to run the method, the run-as mode (CLIENT_IDENTITY, SPECIFIED_IDENTITY, or SYSTEM_IDENTITY), and how transactions should be managed for the method (using the TX_XXX constants).
Passed To: DeploymentDescriptor.setControlDescriptors()
Returned By: DeploymentDescriptor.getControlDescriptors()
DeploymentDescriptor is a serializable class that contains all the parameters that tell an EJB container how to deploy and manage a bean. A serialized DeploymentDescriptor object is packaged with the relevant classes for an EJB object when it is deployed within an EJB container. The container deserializes the DeploymentDescriptor object and reads the deployment information from it.
This abstract base class defines deployment properties that apply to any type of bean; the SessionDescriptor and EntityDescriptor subclasses define additional properties specific to deploying session beans and entity beans.
The DeploymentDescriptor provides access to a list of AccessControlEntry objects that specify the access levels for the methods on the bean, as well as a list of ControlDescriptor objects that specify how transactions and security features should be handled for specific methods on the bean. The descriptor also contains the class names for the bean implementation class, its home interface, and its remote interface, as well as a boolean flag that indicates whether the bean is reentrant.
Subclasses: EntityDescriptor, SessionDescriptor
This extension of DeploymentDescriptor adds deployment properties specific to entity beans. It contains a list of bean properties whose persistence should be managed by the container, as well as the name of the bean's primary key class.
This extension of DeploymentDescriptor class adds deployment properties specific to session beans. Included are the bean's timeout period and whether it's stateful or stateless.
Copyright © 2001 O'Reilly & Associates. All rights reserved.