Interface ReplicatedStorage


  • public interface ReplicatedStorage

    A ReplicatedStorage instance represents a lookup table that is transparently shared between instances of a resource adaptor entity on all nodes of a Rhino cluster. Resource adaptors use this facility to share state about activities, so that any node can continue processing any activity in the event of a failure.

    Resource adaptors specify replicated storage instances via extension deployment descriptor entries. Resource adaptors should specify an instance for each type of activity or state they are dealing with. Each instance represents a different "key space", so the keys used to lookup state must be unique within each instance.

    Resource adaptor implementors should ensure that the ActivityHandle implementation contains enough information to retrieve activity state stored in the ReplicatedStorage instance. The ActivityHandle is automatically replicated by the SLEE, and in the event of a failover, the SLEE will inform each surviving resource adaptor object of the resource adaptor entity which activity handles it should adopt. See ReplicatingResourceAdaptor.adoptActivities().

    All methods on ReplicatedStorage are mandatory transactional. That is, if a transaction is not already in progress, the resource adaptor must initiate a transaction before calling any methods on a replicated storage instance. The resource adaptor should use the SLEE transaction manager availble from ResourceAdaptorContext.getSleeTransactionManager() to check if a transaction is active and create one if required. The resource adaptor should register a Synchronization listener for the transaction so that it will continue processing only after the transaction committed successfully, so the replicated state is consistent across all nodes. Similarly if the transaction fails to commit, or an exception is thrown by one of the ReplicatedStorage methods, the resource adaptor should take appropriate action such as returning NACKs to the resource.

    See Also:
    ReplicatingResourceAdaptor