Tutorials : J2EE Activity Service for Extended Transactions :

Architecture:

The two main components in the J2EE activity service are the Activity service and the High Level Service (HLS).

The HLS is the implementation of a specific extended unit of a work model which allows the interfaces and API to interact with both the application that uses it and the application server that hosts it. The HLS delegates control to the Activity service which in turn manages the actual relationships between this transaction context and other JTS contexts. The implementation of the HLS is not defined in the J2EE activity specification. It is defined by the actual implementer of the specific UOW model.

The Activity service manages the HLS’s service context. It provides interfaces to the HLS for support context demarcation and coordination of the HLS specific objects. The application interacts with the activity service through the HLS.

Features:

Pluggable transaction models:

The J2EE activity service is designed in such a way that the extended transaction services can be managed by any application server without needing to know the details of the smaller transactions. Furthermore it makes it independent of any application server whereby transaction services can be portable across any J2EE compliant application server. The portability is ensured by the portable extended services.

Generic Coordination:

The responsibility of distributing HLS specific messages between the HLS and the Activity service is shared by both of them. The Activity service provides the framework for sending generic messages to activity participants, but the activity participants and the messages are implemented by the HLS that uses the Activity service. The HLS provides a SignalSet that is responsible for producing signals or messages. The Activity Coordinator is part of the Activity service which in turn registers all the SignalSets within itself. It also drives the SignalSets to generate signals at the appropriate time and then distributes the signals to the right participants.

Grouping and Management of Context:

The HLS can start new activities or can create an activity as a child activity fully encapsulated within a bigger activity. An activity can have one or more JTA transactions within it or can itself be encapsulated within a JTA transaction. The Activity service context can help propagate a defined context activity in one application server to another. The Activity service supports Context Groups which can be used by the HLS to group disparate activities in a single group and manage them cooperatively. However activities started by the same HLS on the same thread may be totally unrelated. The HLS may group activities into one context group.

Activity Lifecycle:

All activities are started and ended by operations on the UserActivity interface and is controlled by the ActivityCoordinator. The Activity service ensures that only the component that started an activity can complete the activity or force a premature completion. Attempts by any other component throws a NotOriginatorException. It also throws a ActivtyPendingException if a parent activity tries to complete with an outstanding child activity still pending completion. However if an application working under an Activity context is not performing any work for an extended period of time, the container can hibernate the activity. Hibernation suspends the activity from the active thread and makes the resources of the activity passive and removes them from active memory. The hibernated activity can be revived when further work is requested on the activity by bringing it back to active memory. The hibernation process has nothing to do with the persistence mechanism for activities.

Distributed Service Context:

The behavior of distributed components running under an Activity context is made location independent by use of an Activity service context that is propagated implicitly on all remote calls.

Distributed Application Property Data:

A distributed activity may consist of a number of components and resources distributed over a variety of remote servers. The J2EE Activity specification provides for a PropertyGroup context to enable different components to share application specific property data.

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.