Interface PartitionedActivityHandle

  • All Superinterfaces:
    ActivityHandle

    public interface PartitionedActivityHandle
    extends ActivityHandle

    Rhino extension to the SLEE-defined ActivityHandle interface that allows a resource adaptor to provide activity state partitioning information to Rhino.

    If a resource adaptor starts an activity in the SLEE with an activity handle that implements this interface, then Rhino will use the partition key returned by the handle as a session-related hash for that activity. The partition key is used by a key/value store, for example, to aggregate related session state into the same database partition. For activities whose activity handles only implement the standard ActivityHandle interface, Rhino uses the hash code of the activity handle object for the activity’s partition key instead.

    • Activities started for network-originating events that start a new "session" (whatever that means to the resource adaptor) typically do not need to implement this interface, but may do so if they wish.

    • For SBB-generated activities, if the resource adaptor wishes to utilise partition aggregation of activity state, then the activity handle for the newly created activity should implement this interface to return the partition key obtained from PartitioningFacility.getTransactionPartitionKey().

    • Any given activity must always be identified with an equivalent ActivityHandle during its lifetime. That is, if an activity is started using a PartitionedActivityHandle, then an identical activity handle with the same partition key must always be used. Failure to use an equivalent activity handle may result in the activity state not being found in Rhino.

    • In order to satisfy the requirement immediately above, partition keys used by a resource adaptor that have been provided by Rhino need to be stored somewhere by the resource adaptor so that the resource adaptor can regenerate the same activity handle at any time on any node while the session remains active. Storing the partition key as an attribute on a com.opencloud.rhino.facilities.sessionownership.SessionOwnershipRecord is one option.

    Since:
    Rhino 3.0.0
    See Also:
    PartitioningFacility
    • Method Detail

      • getPartitionKey

        int getPartitionKey()

        Get the partition key for this activity handle. The partition key must be consistent across multiple Java VM processes and marshal/unmarshal operations.

        Returns:
        a partition key.
        Since:
        Rhino 3.0.0