org.systinet.wasp.wsrm.sequence
Interface OutputSequence

All Superinterfaces:
OneWaySequence, Sequence

public interface OutputSequence
extends OneWaySequence

Used for one-way invocation or for sending messages in request-response pattern.

Since:
SSJ 6.5
Component:
WS Reliable Messaging Interfaces

Nested Class Summary
 
Nested classes inherited from class org.systinet.wasp.wsrm.sequence.OneWaySequence
OneWaySequence.MessageState, OneWaySequence.State
 
Field Summary
 
Fields inherited from interface org.systinet.wasp.wsrm.sequence.OneWaySequence
UNKNOWN_LENGTH
 
Method Summary
 void finish()
          Closes this sequence.
 long getCurrentLength()
          Returns the number of messages in this (possibly open) sequence.
 void setLength(long length)
          Sets the length of this output sequence.
 
Methods inherited from interface org.systinet.wasp.wsrm.sequence.OneWaySequence
abort, getExpires, getLength, getMessageState, getState, getWireId, isActive, isExpired, isOutput, setActive
 
Methods inherited from interface org.systinet.wasp.wsrm.sequence.Sequence
getID, setExpires
 

Method Detail

getCurrentLength

public long getCurrentLength()
Returns the number of messages in this (possibly open) sequence. Use when getting an incomplete output sequence and wanting to know how many messages has already been sent.

Note that the returned value denotes the number of messages already processed. Since messages are usually processed asynchronously, care should be taken not to use it in situations where it is unclear how many unprocessed messages are pending.

Returns:
number of messages in a sequence. In case of a complete sequence, it is equal to OneWaySequence.getLength().

setLength

public void setLength(long length)
               throws SequenceException
Sets the length of this output sequence. The length can be also set by calling method finish(). In such a case, the sequence length is set to the current sequence length incremented by one and an empty message (marked as last) is sent.

Please note that


finish

public void finish()
            throws SequenceException
Closes this sequence. In case that the sequence length has not been already set or has been set to a larger number than is the number of currently sent messages, it also sends an empty message (marked as last) denoting end of this sequence.

Throws:
SequenceException