JSR95 (Activity Service) Reference Implementation (RI) User Guide


Table of Contents

Introduction
The Reference Implementation and the JSR95 Specification
How to use the RI
The Reference Implementation Package
Description of main RI classes
Rebuilding the RI
JSR-095 Refence Implementation License Agreement

Introduction

This document describes the Reference Implementation for the JSR95 J2EE Activity Service Specification. It includes details of how the Reference Implementation may be used and instructions on how to integrate this implementation into the J2EE server environment.

An outline of the design of the package is also provided.

The Reference Implementation and the JSR95 Specification

The JSR95 specification is the J2EE realization of the OMG Additional Stucturing Mechanism for the OTS specification. The J2EE Activity service specification defines the J2EE architecture for a high-level service (HLS) that supports an extended unit of work (UOW) model using the facilities of the J2EE Activity service. The specification identifies the following architectural components:

  1. The Activity service itself - this implements the interfaces of the javax.activity package.
  2. The high-level service (HLS). This is an embodiment of a specific extended unit of work that uses the facilities of the Activity service to manage its distributed context and to provide the framework within which signals pertaining to the HLS are distributed to participants in an HLS unit of work. The HLS implements the interfaces of the javax.activity.coordination package and optionally the javax.activity.propertygroup package.
  3. The distributed subsystem - for example, the OMG Activity service defines the interoperable distribution of Activity service contexts over IIOP.

The JSR95 RI provides an implementation of the Activity service, implementing the interfaces of the javax.activity package described in the J2EE Activity Service Specification. The RI includes thread-related Activity Context management operations such as begin, complete, suspend and resume and Activity coordination functions supported by the ActivityCoordinator interface.

The JSR95 TCK download includes an implementation of a test HLS which drives the functions of the Activity service RI.

How to use the RI

The Activity Service is used by a High Level Service (HLS) and is initialized by the HLS. An HLS implements the javax.activity.coordination.ServiceManager interface which it registers through the registerService method of the Activity service's implementation of the UserActivity or ActivityManager interfaces. In the RI these implementation classes are com.ibm.activity.reference.UserActivityImpl and com.ibm.activity.reference.ActivityManagerImpl respectively. In a J2EE environment, an HLS may obtain the reference to an ActivityManager object, for example, by performing a JNDI lookup of services:activity/ActivityManager. The RI may be integrated into a J2EE environment by binding a Reference to the com.ibm.activity.reference.ActivityManagerImpl class into JNDI at this location. The RI may also be used in a standalone environment by creating an instance of the com.ibm.activity.reference.ActivityManagerImpl class using its public default constructor.

The Reference Implementation Package

The Reference Implementation is packaged as a single zip file, jsr95_ri.zip. The contents of this file are as follows

readme.ri.txt
A text file containing basic instructions.
jsr95ri.jar
A jar file containing source java files and compiled class files for the Reference Implementation. in the com.ibm.activity.reference package.
jsr95bld_ri.bat
A command file that may be used to rebuild jsr95ri.jar.
setenv.bat
A configuration file for rebuilding the RI.
j2ee_activity.jar
A jar file containing the source java and compiled class files of the javax.activity package.
jsr95ri.html
This document.

Description of main RI classes

The following paragraphs describe the major components associated with the Reference Implementation. Each section outlines the role of a particular class with emphasis on overall responsibilities rather than on method details. The latter is documented via the javadoc embedded in the source files.

ActivityManagerImpl and UserActivityImpl

The ActivityManager and UserActivity implementations are the entry point to the Activity service and provide context demarcation and context-thread association. Most function is actually delegated to a per-Activity LocalActivityContext object. A ThreadContextManager singleton manages the association of LocalActivityContexts to threads.

These classes also manage the registration of an HLS.

LocalActivityContext

This class encapsulates the concept of a context, providing operations that are checked for validity. This provides much of the functionality required by the UserActivity/ActivityManager API.

To support the getPropertyGroup method, a table of PropertyGroups is maintained. This is populated during Activity initiation (begin) using the supplied ServiceManager interface object.

ThreadContextManager

The ThreadContextManager class allows contexts to be located. It consists of a series of tables of 'active' context vs thread for each context group and allows the 'current' context on any thread for any HLS to be located (used by the UserActivity and ActivityManager functions).

ActivityCoordinatorImpl

This class manages Actions, priorities and SignalSets and coordinates the distribution of Signals to Actions.

Activity 'completion' processing will be shared between this class and the LocalActivityContext, since the completion involves responsibilities that are split between the two. The completion is likely to take the following sequence

Rebuilding the RI

A command file, jsr95bld_ri.bat, is provided to rebuild jsr95ri.jar. Before running this command file you need to extract the contents of the jsr95ri.jar to the working directory. In addition, you need to edit the setenv.bat file to set the following environment variables:

JSR 95 Reference Implementation License Agreement

BY DOWNLOADING OR USING THE SOFTWARE AND/OR DOCUMENTATION DESCRIBED IN EXHIBIT A HERERTO (COLLECTIVELY THE "SOFTWARE"), YOU AGREE TO THE FOLLOWING TERMS AND CONDITIONS ("AGREEMENT"). IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT, YOU MAY NOT DOWNLOAD OR USE THE SOFTWARE.

License Grant. International Business Machines Corporation or one of its subsidiaries (collectively "IBM") hereby grants you (an individual or an entity) a non-exclusive, non-transferable, worldwide, royalty free license to use, reproduce, display, perform, prepare derivative works of, and distribute the Software and derivative works thereof. The above license includes the right to sublicense the above rights to third parties acting on your behalf.  

To the extent IBM provides you with error corrections, upgrades, enhancements, additions, improvements, extension or other modifications to the Software such error corrections, upgrades, enhancements, additions, improvements, extension or other modifications shall be considered Software and shall be subject to the terms and conditions of this Agreement.

You agree not to remove any of the copyright statements, disclaimers or other proprietary notices contained in the Software.  

You agree to defend, indemnify, hold harmless IBM and its suppliers from and against any claims, lawsuits, demands, liabilities, damages, costs and expenses including, without limitation, attorney fees, in any way related to, connected with, or arising out of, your use, modification, reproduction, distribution and/or sublicensing of the Software.  

Compatibility Claims. You agree that you will distribute, or sublicense others to distribute, the Software and derivative works thereof only if (i) you or such third party have tested the Software and derivative works thereof with the applicable JSR 95 TCK, and (ii) such Software and derivative work have complied with the relevant portions of such TCK. You may not claim that any Software or derivative work thereof passes the applicable TCK, and therefore is compatible with the applicable JSR 95 specification, unless it is capable of passing the most current version of the TCK available one hundred and twenty (120) days prior to the date of shipment. You will make available information regarding the version of the TCK passed, upon request. You agree that any claims regarding compliance with the Specification will be factually accurate and will not be misleading. Additional rules, if any, regarding your ability to make claims regarding your use of the TCK or any result therefrom can be found in the TCK license agreement.

Support.   Although IBM may try to answer technical support questions that you may have regarding your use of the Software, IBM has no obligation to provide error corrections, upgrades, enhancements, additions, improvements, extension or other modifications to the Software or to provide any end user or technical support for the Software. You shall be responsible for any and all maintenance, end-user support and technical support with respect to the Software.

No Warranties.  THE SOFTWARE AND ANY SUPPORT ARE PROVIDED "AS IS" WITHOUT WARRANTY OR CONDITION OF ANY KIND, EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OR CONDITIONS OF MERCHANTABILITY OR SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL WARRANTIES AND CONDITIONS, EXPRESS, IMPLIED, AND STATUTORY ARE HEREBY DISLCAIMED. THE ENTIRE RISK ARISING OUT OF THE USE OR PERFORMANCE OF THE SOFTWARE AND SUPPORT REMAINS WITH YOU.  

No Liability.  TO THE FULLEST EXTENT PERMITTED BY LAW, IN NO EVENT WILL IBM OR ITS SUPPLIERS BE LIABLE FOR ANY LOST PROFITS, LOST SAVINGS, LOST REVENUE, LOST DATA, PROCUREMENT OF SUBSTITUTE GOODS, OR FOR ANY DIRECT, INDIRECT, INCIDENTAL. SPECIAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, EVEN IF IBM OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSSES OR DAMAGES. IN ADDITION, IBM AND ITS SUPPLIERS WILL NOT BE LIABLE FOR ANY DAMAGES CLAIMED BY YOU BASED ON ANY THIRD PARTY CLAIM.  

Some jurisdictions do not allow the exclusion of implied warranties, or the limitation for consequential damages, so the above may not apply to you.

Note to U.S. Government Users - Documentation related to Restricted Rights - Use, duplication, or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corporation.  

Covenant Not to Assert.  To the extent that you have any patents which cover the use of the Software in any manner permitted under this Agreement, you hereby agree not to assert any such patents against the developers or distributors of the Software or any other parties who have entered into a license substantially similar to this Agreement for the licensed use of the Software.  

Reciprocity.  You may now have, or may in the future have, the ability to license reference implementations developed or distributed pursuant to the Java Community Process ("Java Materials"). You acknowledge that under this license you are receiving the Software under reasonable royalty-free terms. While you are not obligated to make Java Materials available, if you do so, you agree to license them under reasonable royalty-free terms. For the purpose of this paragraph, terms are not 'reasonable terms' if they are more restrictive than those of this license, or if they discriminate against any individual or group of JCP members or against any implementer of an independent implementation or an open source implementation. If you do make Java Materials available in the future and do not license such Java Materials under reasonable royalty-free terms, as consideration for licensing this Software to you, you agree to pay IBM royalties as follows: (a) Fifty Thousand Dollars ($50,000) payable within forty five (45) days of your distribution of such Java Materials; and (b) an additional Ten Thousand Dollars ($10,000) per year, starting in the year after your first year of distribution, for each year during which you use or distribute the Software or any derivative work thereof. In no event shall such royalties in the aggregate exceed Eighty Thousand Dollars ($80,000.) In the event that you will pay IBM under this reciprocity clause, you agree to contact IBM's JSR Specification lead, who will instruct you whom you should contact to make arrangements to set up such royalty payments.  

Payment Terms. Subject to the receipt of a timely and correctly presented invoice from IBM, payments identified under the Reciprocity paragraph above shall be made within forty-five (45) days of your receipt of IBM's invoice.

General.  

You agree to comply with all applicable export laws and regulations.  

No other rights or licenses are granted by implication, estoppel or otherwise.  

If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.  

Your rights under this Agreement shall terminate if you fail to comply with any of the material terms or conditions of this Agreement and do not cure such failure in a reasonable period of time after becoming aware of such non-compliance. If all your rights under this Agreement terminate, you agree to cease use of the Software immediately.  

This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights (if any) to a jury trial in any resulting litigation.  

This Agreement is the only understanding and agreement we have with respect to the Software. It supersedes all other communications, understandings or agreements (oral or written) that we may have had with respect to the Software prior to this Agreement. Only a written agreement signed by both of us can modify this Agreement.

Exhibit A  

The "SOFTWARE" to which this license applies is the Java Specification Request (JSR) 095 for the J2EE Activity Service reference implementations (RI).