Appendix A. The Enterprise JavaBeans APIThis appendix is a quick reference guide to the Enterprise JavaBeans API. It is broken down into sections. First, we look at the classes in the javax.ejb package, followed by the classes in the javax.ejb.deployment package (EJB 1.0 only). Within each package, the classes are organized alphabetically. A.1. Package: javax.ejbThis package contains the heart of the EJB API. It consists mostly of interfaces, many of which are implemented by your EJB vendor. These interfaces essentially define the services provided by the bean's container, the services that must be implemented by the bean itself, and the client interface to an enterprise bean. The package also contains a number of exceptions that are thrown by enterprise beans. A.1.1. CreateExceptionThis standard application exception must be thrown by all create methods defined in the home interface to indicate that the bean could not be created.
A.1.2. DuplicateKeyExceptionThis standard application exception is thrown by the create methods of the home interface of entity beans, and it indicates that a bean already exists with the same primary key.
A.1.3. EJBContextThis is the base class for both EntityContext and SessionContext. EJBContext is the bean class's interface to the container system. It provides information about the security identity and transaction status. It also provides access to environment variables and the bean's EJB home.
A.1.4. EJBException (1.1)This RuntimeException is thrown by the bean class from its business methods and callback methods to indicate that an unexpected exception has occurred. The exception causes a transaction to be rolled back and the bean instance to be destroyed.
A.1.5. EJBHomeThis interface must be extended by the bean's home interface, a developer-provided class that defines the life-cycle methods of the bean. The bean's create and find methods are defined in the home interface. This interface is implemented by the bean's EJB home.
A.1.6. EJBMetaDataThis interface is implemented by the container vendor to provide a serializable class that contains information about the bean.
A.1.7. EJBObjectThis interface defines the base functionality for access to enterprise beans; it is implemented by the EJB object. The developer must provide a remote interface for the bean that defines the business methods of the bean; the remote interface must extend the EJBObject interface.
A.1.8. EnterpriseBeanThis interface is extended by both the EntityBean and SessionBean interfaces. It serves as a common typing mechanism.
A.1.9. EntityBeanThis interface must be implemented by the entity bean class. It provides a set of callback notification methods that alert the bean instance that it is about to experience or just has experienced some change in its life cycle.
A.1.10. EntityContextThis interface is a specialization of the EJBContext that provides methods for obtaining an EntityBean's EJB object reference and primary key. The EntityContext provides the bean instance with an interface to the container.
A.1.11. FinderExceptionThis standard application exception is thrown by find methods defined in the home interface to indicate that a failure occurred during the execution of the find method.
A.1.12. HandleThis interface provides the client with a serializable object that can be used to obtain a remote reference to a specific bean.
A.1.13. HomeHandle (1.1)This interface provides the client with a serializable object that can be used to obtain a remote reference to a bean's home.
A.1.14. NoSuchEntityException (1.1)This EJBException is typically thrown by the bean class's ejbLoad() and ejbStore() methods to indicate that the entity's data does not exist. For example, this exception will be thrown if an entity bean with bean-managed persistence attempts to read its state (ejbLoad()) from a record that has been deleted from the database.
A.1.15. ObjectNotFoundExceptionThis standard application exception is thrown by the home interface's find methods that return only one EJB object. It indicates that no bean matching the specified criteria could be found.
A.1.16. RemoveExceptionThis standard application exception is thrown by remove methods to indicate that the failure occurred while removing the bean.
A.1.17. SessionBeanThis interface must be implemented by the session bean class. It provides a set of callback notification methods that alert the bean instance that it has experienced, or is about to experience, some change in its life cycle.
A.1.18. SessionContextThis interface is a specialization of the EJBContext that provides methods for obtaining the SessionBean's EJB object reference. SessionContext provides the bean instance with an interface to the container.
A.1.19. SessionSynchronizationThis interface provides a stateful bean instance with additional callback notifications. These callback methods notify the bean of its current state with respect to a transaction.
![]() Copyright © 2001 O'Reilly & Associates. All rights reserved. |
|