GlassFish Server Open Source Edition 3.1 - EJB One Pager

1. Introduction

1.1. Project/Component Working Name:

EJB Container

1.2. Name(s) and e-mail address of Document Author(s)/Supplier:

Marina Vatkina : marina.vatkina@oracle.com

1.3. Date of This Document:

...

2. Project Summary

2.1. Project Description:

Enterprise Java Beans features for GlassFish Server Open Source Edition 3.1.

  • SFSB Checkpointing
  • EJB Timer Clustering / Failover
  • (Dropped) Support Weblogic EJB descriptor
  • Full EJB 3.1 feature support in Embeddable EJB API
  • Retain SFSB / EJB Timer state across redeployment
  • User-specified thread pools for EJB timer and async callbacks
  • Option to disable V2 vendor-specific JNDI names
  • (Dropped) Additional DTrace probes

2.2. Risks and Assumptions:

The highest priority features are SFSB checkpointing and EJB Timer Clustering / Failover. These depend on the core admin / deployment clustering support, as well as on GMS. Delays in availability of this functionality will affect the delivery of the EJB clustering features.

The assumption is that an application deployed to the cluster will have the same 'appID / containerID' in each instance.

3. Problem Summary

3.1. Problem Area:

This work will provide the necessary EJB container updates to achieve high availability and failover within the V3.1 release. Time allowing, it will also add some requested features that could not be achieved in the V3 release.

3.2. Justification:

The main drivers for this work are the HA/failover requirements in V3.1. Clustering and failover of Java EE applications means support is needed for Stateful Session bean high availability, EJB timer high availability, and Remote EJB load balancing and failover over IIOP(covered in a separate document).

  • SFSB Checkpointing

Feature parity with V2. Also part of the top-priority feature set for V3.1

  • EJB Timer Clustering / Failover

Feature parity with V2. Also part of the top-priority feature set for V3.1

  • (Dropped) Support Weblogic EJB descriptor

Enable WebLogic applications developed by ISVs to run on GlassFish.
Enable users to develop applications with simple WebLogic extensions on Glassfish and then run on WebLogic.

  • Full EJB 3.1 feature support in Embeddable EJB API

Improves ease of development by allowing a larger set of EJB applications to be portably tested outside of the server.

  • Retain SFSB / EJB Timer state across redeployment

Ease of development

  • User-specified thread pools for EJB timer and async callbacks

Better performance for applications using the new EJB 3.1 features

  • Option to disable V2 vendor-specific JNDI names

Ease of use

  • (Dropped) Additional DTrace probes

Better monitoring support

4. Technical Description:

4.1. Details:

All EJB clustering and high availability behavior from GlassFish V2 will be fully backward compatible within V3. For the most part this will be accomplished by porting the existing V2 code to V3. The one new feature in the HA area is support for cluster-based automatic timer creation. Automatic timer creation is a new feature of the EJB 3.1
specification and first appeared in GlassFish V3.

Feature list :

4.1.1. SFSB Checkpointing

Support high availability of stateful session bean state in the cluster. This requires checkpointing the state to a backing store. The details of the backing store implementation are hidden from the container. All interactions with the store are made through the new SPI provided by 'ha-api' module. All behavior will be identical to V2. This work also includes support for handling the serialization / deserialization of EJB reference objects stored in Stateful Session beans and HTTP Sessions. Configuration of this behavior will be identical to V2.

4.1.2. EJB Timer Clustering / Failover

Support correct timer semantics in the cluster, as well as timer high availability. The basic rule governing timer semantics in a cluster is that for each unique EJB timer, each timer callback happens on exactly one server instance. The application is not dependent on which server instance is chosen, nor is there any assumption that the same server instance will be chosen for multiple callbacks of the same timer. All V2 functionality will be supported. The only new functionality is support for EJB 3.1 automatic timer creation. Configuration of this behavior will be identical to V2.

4.1.3. (Dropped) Support Weblogic EJB descriptor

Support Weblogic dtd elements marked as "low" impact during initial analysis. These are the elements that have straightforward direct mapping to existing glassfish behavior.

4.1.4 Full EJB 3.1 feature support in Embeddable EJB API

The EJB 3.1 spec only requires the Embeddable EJB API implementation to support at minimum the portion of the EJB API covered by EJB 3.1 Lite (essentially local session beans and container-managed transactions). The GlassFish V3 implementation went beyond that subset a bit to support asynchronous invocations and the remote view. However, more work is needed to support the entire EJB 3.1 API within the embeddable EJB 3.1 container. Missing features are : message-driven beans, web service endpoints, remote EJBs with non-default IIOP ports, and the timer service.

4.1.5 Retain SFSB / EJB Timer state across redeployment

This will allow Stateful session bean instances and persistently created EJB timers to be retained between redeployments. A similar feature was added in GlassFish V3 for HTTP Session retention. The existing default behavior of no retention will still apply in GlassFish V3.

Certain restrictions governing the allowable changes to an application between redeployments will need to be put in place for this feature to work. For example, no changes to the set of instance variables in the SFSB bean class.

User-level configuration will be controlled by a new --keepState option on the asadmin --redeploy command, and a new element in glassfish-ejb-jar.xml. The latter will allow to specify the option for autodeployment. Explicit CLI option will override deployment descriptor setting if any. The default for deployment descriptor false, and for CLI option it will be not set. This combination will always default to no state preservation.

4.1.6 User-specified thread pools for EJB timer and async callbacks

Threads used for EJB timer callbacks and asynchronous invocation dispatches are currently taken from thread pools private to the container that have hard-coded configuration values. This feature provides the option to specify a glassfish-configured thread pool whose threads should be used for these callbacks.

We should be able to reuse 'use-thread-pool-id' element in the gf-ejb-jar.xml. If set, all asynchronous invocation callbacks or timer callbacks of components in the associated module will use the glassfish thread pool associated with the given thread pool ID.

4.1.7 Option to disable V2 vendor-specific JNDI names

Now that the EJB 3.1 specification defines portable EJB JNDI names, there is less need for the old vendor-specific JNDI. By default in V3, GlassFish-specific default JNDI names are applied automatically for backward compatibility, but that can lead to some ease-of-use issues. For example, deploying two different applications containing a Remote EJB component that exposes the same remote interface will cause a conflict between the default JNDI names. The default GlassFish-specific JNDI name behavior will stay the same in V3.1, but a new boolean element called 'disable-nonportable-jndi-names' will be added to gf-ejb-jar.xml and available as a global property under the ejb-container configuration.

4.1.8 (Dropped) Additional DTrace Probes
Add more monitoring probes, especially covering the invocation of javax.ejb.* APIs.

4.2. Bug/RFE Number(s):

Feature RFE
4.1.1 12200
4.1.2 12201
4.1.4 12202
4.1.5 12203
4.1.6 7138
4.1.7 11729

4.3. In Scope:

Aspects that are in scope of this proposal if not obvious from above and not marked as dropped.

4.4. Out of Scope:

  • Inhancements to EJB Timer Service setup in a cluster
  • Dropped Features:
    • Support Weblogic EJB descriptor
    • Additional DTrace Probes

4.5. Interfaces:

4.5.1 Public Interfaces

Interface Comments
New asadmin redeploy option --keepState  
New ejb-container configuration property : disable-nonportable-jndi-names  

4.5.2 Private Interfaces

N/A.

4.5.3 Deprecated/Removed Interfaces:

NONE.

4.6. Doc Impact:

The EJB portion of existing cluster/HA documentation can be reused as is.
A man page update will be needed for the new asadmin redeploy option, and the new gf-ejb-jar.xml elements will need to be documented in the developer guide.

4.7. Admin/Config Impact:

  • CLI

Add --keepState option to asadmin redeploy command.

Support v2 asadmin listTimers '--target' and migrateTimers commands.

  • GUI

Enable manual timer migration through GUI.

4.8. HA Impact:

HA functionality is covered by the SFSB checkpointing and clustered EJB timer features.

4.9. I18N/L10N Impact:

NONE.

4.10. Packaging, Delivery & Upgrade:

4.10.1. Packaging

N/A

4.10.2. Delivery

N/A

4.10.3. Upgrade and Migration:

N/A

4.11. Security Impact:

N/A

4.12. Compatibility Impact

No incompatible changes.

4.13. Dependencies:

4.13.1 Internal Dependencies

  • Admin / Deployment clustering support
  • GMS
  • HA backing store

4.13.2 External Dependencies

NONE.

4.14. Testing Impact:

All existing V2 clustering tests that cover SFSB state or EJB timers can be reused. Additional tests in those areas will need to written to improve coverage. New tests will need to be written for automatic timer creation and the other new features. All tests should be capable of being automated.

5. Reference Documents:

Support for WebLogic Deployment Descriptors in GlassFish 3.1

HA Spec for the BackingStore SPI

6. Schedule:

6.1. Projected Availability:

Feature Integrated Feature Complete
SFSB Checkpointing MS3 MS3
EJB Timer clustering / failover MS3 MS3
Full EJB 3.1 feature support in Embeddable EJB API MS4 MS4
Retain SFSB/EJB Timer state across redeployment MS5 MS5
User-specified thread pools for EJB timer / async callbacks MS5 MS5
Option to disable V2 vendor-specific JNDI names MS5 MS5

Review

Review comments