Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Enterprise JavaBeans™ Specification, v1.1 - Sun Microsystems.pdf
Скачиваний:
11
Добавлен:
24.05.2014
Размер:
1.62 Mб
Скачать

Sun Microsystem Inc

Changes since 1.1 Draft 1

Enterprise JavaBeans v1.1, Final Release

Revision History

C.5 Changes since 1.1 Draft 1

This sections lists the changes since EJB 1.1 Draft 1.

Allow use of the Java 2 java.util.Collection interfaces for the result of entity finder methods.

Defining the FinderException in the finder methods of the home interface is mandatory now.

Clean up of the exception specification, including minor changes from EJB 1.0 summarized in Section 12.6.

The scope of the EJB specification for managing transaction isolation levels was reduced to sessions with bean-managed transaction demarcation. The current EJB specification does not have any API for managing transaction isolation for beans with container-managed transaction demarcation (note that all Entity beans fall into this category).

Eliminated the stateless-session element in the XML DTD. Now the session element is used to describe both the stateful and stateless session beans.

Added an optional description element to the method element. The intention is to allow tools to display the description of the method.

Clarified that the enterprise bean class may have superclasses, and that the business methods and the various container callbacks can be implemented in the enterprise bean class, or in any of its superclasses.

Fixed the example that illustrates the use of handles for session objects. Serialized handles are not guaranteed to be deserializable in a different system, and therefore they cannot be emailed.

Updated the Overview chapter.

Allowed deferring the specification of the primary key class for all entities (not only for those with con- tainer-managed persistence as it was the case in Draft 1).

Allow enterprise beans to print. The Container must grant the permission to the enterprise beans to queue printer job.

The setRollbackOnly() and getRollbackOnly() methods of the EJBContext object must not be used by enterprise beans with bean-managed transaction demarcation. There is no need for these beans to use these methods.

C.6 Changes since 1.1 Draft 2

Fix an error in the requirement for how a Container must deal with inter-EJB invocations when both the calling and called bean are in the same JVM. The correct requirement is that the RMI semantics must be ensured, and therefore the Container must not pass non-remote objects by reference.

297

11/24/99

Sun Microsystems Inc.

Revision History

Enterprise JavaBeans v1.1, Final Release

Changes since 1.1 Draft 2

Clarified the requirements for serialization of the session objects.

Specified that an EJB Compliant Container may always return a null from the deprecated getCallerIdentity() method.

Added a section on distributed transaction scenarios involving access to the same entity from multiple clients in the same transaction.

Changed the specification of the return value type of the ejbCreate(...) methods for entities with container-managed persistence. The previous specification required that the ejbCreate methods are defined as returning void. The new requirement is that the ejbCreate methods be defined as returning the primary key class type. The implementation of the ejbCreate method should return null. This change is to allow tools, if they wish, to create an entity bean with bean-managed persistence by subclassing an original entity bean with container-managed persistence.

For compatibility with EJB 1.0, added the support for the java.rmi.RemoteException to be thrown from the enterprise bean class methods. This is needed to allow an EJB 1.1 Container to support enterprise beans written to the EJB 1.0 specification. The use of the java.rmi.RemoteException in the enterprise bean class methods is deprecated, and new applications should throw the javax.ejb.EJBException instead.

Removed the deprecated package javax.ejb.deployment from the EJB interfaces. The the deprecated package javax.ejb.deployment will be distributed only with the deployment descriptor conversion tool.

Updated the examples in the transaction chapter by removing the setAutoCommit and setTransactionIsolation calls. These calls are not typically done by the enterprise bean.

Added the <method-intf> element to allow a method element to differentiate between a method with same signature when defined in both the remote and home interfaces.

Specified the behavior of the getUserTransaction(), setRollbackOnly(), and getRollbackOnly() methods for the cases when the methods are invoked by beans that are not allowed to use these methods. The Container will throw the java.lang.IllegalException in these situations.

Specified that PortableRemoteObject.narrow(...) must be used by a client to convert the result of Handle.getEJBObject() to the remote interface type.

Required portable enterprise bean clients to use the PortableRemoteObject.narrow(...).

Clarified the minimal lifetime for handles.

Clarified that the caller must have at least one security role (not all) associated with the method permission in order to be allowed to invoke the method.

Support for entities has been made mandatory for the Container Provider.

Added a section to the Exception chapter dealing with the release of resources held by the instance when the instance is being discarded because of a system exception.

11/24/99

298

Sun Microsystem Inc

Changes since EJB 1.1 Draft 3

Enterprise JavaBeans v1.1, Final Release

Revision History

Added the res-auth element to the deployment descriptor for the Bean Provider to indicate whether the bean code performs an explicit sign-on to a resource manager, or whether the Bean relies on the Container to perform sign-on based on the information supplied by Deployer.

Added java.io.Serializable as a superinterface of javax.ejb.Handle. The EJB 1.0 spec required that the implementation class implements the java.io.Serializable interface, this change expresses the requirement syntactically.

Added the interface javax.ejb.HomeHandle to provide support for handles for home objects.

Allowed a Session bean instance to be removed upon a timeout while the instance is in the passivated state.

Add the javax.ejb.NoSuchEntityException exception to the API. Added requirements for throwing the java.rmi.NoSuchObjectExcetion to the chapter on exceptions.

C.7 Changes since EJB 1.1 Draft 3

Replaced the support for environment properties with the JNDI API-based environment entries. The EJB 1.0 style of environment properties access is deprecated in EJB 1.1.

Removed the finalize() method from the state diagrams. Specified that an enterprise bean must not define the finalize() method in the enterprise bean class. This is because it cannot be guaranteed that the method is called at all in some Container implementations.

Made clear that the result of comparing two object reference using the Java "==" operator or the equals() method is undefined.

Added Tables 2, 3, and 4 that specify which operations are allowed in the enterprise bean methods.

Clarified what “proper transaction context” means in the Chapter on entities.

Flattened the DTD hierarchy by removing the elements that grouped entries of the same type.

Relaxed the rules for the primary key class. An entity with bean-managed persistence can use any RMI-IIOP Value Type as its primary key type; the primary key type of an entity with container-managed persistence is more constrained.

Added the isStatelessSession() method to the EJBMetaData interface.

Updated the chapter in distribution to simply reference RMI-IIOP. The original chapter had been written before RMI-IIOP was completed.

299

11/24/99

Sun Microsystems Inc.

Revision History

Enterprise JavaBeans v1.1, Final Release

Changes since EJB 1.1 Public Draft

C.8 Changes since EJB 1.1 Public Draft

Added the ejb-client-jar element to the deployment descriptor to allow the ejb-jar file producer to specify a JAR file that contains the classes necessary to access the enterprise beans in the ejb-jar file.

The value of the res-auth element was changed to Application (it was Bean) to be consistent with the Java 2, Enterprise Edition platform specification.

Changed the lexical rules for the env-entry-value element so that values of the type String need not be double-quoted in the deployment descriptor. See subsection 14.2.1.2.

Added the requirement for the Container to provide the UserTransaction interface to the enterprise bean instances in the environment JNDI API context under the name java:comp/UserTransaction. See section 14.6.

Clarified that the container must never return a null from the getCallerPrincipal() method.

Allow the stateful session bean’s ejbCreate, ejbRemove, ejbActivate, and ejbPassivate methods to access resource managers without transaction context. This was allowed in EJB 1.0.

Cleaned up the description of transactions. Removed the confusing term local transaction, and created the description of how a Container may deal with the resource manager updates from a method that runs with an unspecified transaction context into Section 11.6.3 (the term local transaction was used to refer to the cases that are now covered by this section).

Added an explanation of how ejbLoad and ejbStore work for entity bean instances that execute with an unspecified transaction context. See subsection 9.1.7.1.

Fixed the argument type of the isIdentical(EJBObject) method. The spec showed it incorrectly as java.lang.Object. The EJB class files and javadoc have always been correct.

Disallowed the use of UserTransaction in the setSessionContext method, as specified in Tables 2 and 3.

Specified which methods can be assigned a transaction attribute, and which methods can be included in method-permission elements.

Clarified in Subsection 12.3.6 which “resources” the Container is responsible for releasing when an instance is being discarded.

Augmented the restrictions on client’s security context in Section 15.5 to cover the case in which requests in the same transaction are received from multiple intermediate objects.

Moved the description of the “transaction diamond” scenario from Subsection 9.1.13 to Subsection 11.7. Described also the transaction diamond scenario for Session Beans.

Clarified the scope of the env-entry-name, ejb-ref-name, res-ref-name, secu- rity-role-ref and role-name elements.

11/24/99

300