org.systinet.wasp.wsrm.sequence
Class SequenceRegistry

java.lang.Object
  extended byorg.systinet.wasp.wsrm.sequence.SequenceRegistry

public abstract class SequenceRegistry
extends java.lang.Object

Contains useful methods for sequence management. These methods are independent of WS-RM implementation and version.

Since:
SSJ 6.5
Component:
WS Reliable Messaging Interfaces

Field Summary
protected static org.systinet.wasp.wsrm.sequence.ProcessingRegistry processingRegistry
           
 
Constructor Summary
SequenceRegistry()
           
 
Method Summary
static void addSequenceListener(SequenceListener listener)
          Installs sequence listener monitoring changes on sequences.
static void addSequenceListener(SequenceListener listener, Processing processing)
          Installs the listener monitoring changes of OneWaySequence.State of all sequences related to given processing.
static InputSequence getActiveInputSequence()
          Returns an input sequence active in current processing or null if there is no such sequence.
static InputSequence getActiveInputSequence(CallContext callContext)
          Returns an input sequence active in the given processing or null if there is no such sequence.
static OutputSequence getActiveOutputSequence()
          Returns an output sequence active in current processing or null if there is no such sequence.
static OutputSequence getActiveOutputSequence(CallContext callContext)
          Returns an output sequence active in the given processing or null if there is no such sequence.
static void removeSequenceListener(SequenceListener listener)
          Removes the sequence listener registered by calling addSequenceListener(SequenceListener) method.
static void removeSequenceListener(SequenceListener listener, Processing processing)
          Removes the SequenceListener installed by addSequenceListener(SequenceListener, Processing) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

processingRegistry

protected static final org.systinet.wasp.wsrm.sequence.ProcessingRegistry processingRegistry
Constructor Detail

SequenceRegistry

public SequenceRegistry()
Method Detail

addSequenceListener

public static void addSequenceListener(SequenceListener listener,
                                       Processing processing)
Installs the listener monitoring changes of OneWaySequence.State of all sequences related to given processing.

There should be used a ServiceEndpointListener on the service side to add a sequence listener for all service endpoint sequences:
     public class MyService implements ServiceEndpointListener {

         private SequenceListener listener = new MySequenceListener();

         public void onPublish(ServiceEndpoint serviceEndpoint) {
             SequenceRegistry.addSequenceListener(this.listener, serviceEndpoint);
         }

         public void onUnpublish(ServiceEndpoint serviceEndpoint) {
             SequenceRegistry.removeSequenceListener(this.listener, serviceEndpoint);
         }

         public String hello(String msg) {
             ...
         }
         ...
     }
 


removeSequenceListener

public static void removeSequenceListener(SequenceListener listener,
                                          Processing processing)
Removes the SequenceListener installed by addSequenceListener(SequenceListener, Processing) method.

See Also:
addSequenceListener(SequenceListener, org.systinet.wasp.webservice.Processing)

addSequenceListener

public static void addSequenceListener(SequenceListener listener)
Installs sequence listener monitoring changes on sequences. Methods of the provided listener instance will be called on all instances of sequences regardless of the processing the sequences are associated with.

See Also:
addSequenceListener(SequenceListener, org.systinet.wasp.webservice.Processing)

removeSequenceListener

public static void removeSequenceListener(SequenceListener listener)
Removes the sequence listener registered by calling addSequenceListener(SequenceListener) method.

See Also:
removeSequenceListener(SequenceListener, org.systinet.wasp.webservice.Processing)

getActiveOutputSequence

public static OutputSequence getActiveOutputSequence()
                                              throws java.lang.IllegalStateException
Returns an output sequence active in current processing or null if there is no such sequence.

Throws:
java.lang.IllegalStateException

getActiveOutputSequence

public static OutputSequence getActiveOutputSequence(CallContext callContext)
                                              throws java.lang.IllegalStateException
Returns an output sequence active in the given processing or null if there is no such sequence.

Parameters:
callContext - CallContext of the given processing.
Throws:
java.lang.IllegalStateException
See Also:
getActiveOutputSequence()

getActiveInputSequence

public static InputSequence getActiveInputSequence()
                                            throws java.lang.IllegalStateException
Returns an input sequence active in current processing or null if there is no such sequence. Use this method in service implementation to obtain the input sequence containing current request or in AsyncCallback.onResponse(org.systinet.wasp.async.AsyncConversation) to obtain the input sequence containing current response.

Throws:
java.lang.IllegalStateException

getActiveInputSequence

public static InputSequence getActiveInputSequence(CallContext callContext)
                                            throws java.lang.IllegalStateException
Returns an input sequence active in the given processing or null if there is no such sequence.

Parameters:
callContext - CallContext of the given processing.
Throws:
java.lang.IllegalStateException
See Also:
getActiveInputSequence()