Apache CXF API

org.apache.cxf.ws.rm.soap
Class RetransmissionQueueImpl

java.lang.Object
  extended by org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl
All Implemented Interfaces:
RetransmissionQueue

public class RetransmissionQueueImpl
extends Object
implements RetransmissionQueue


Nested Class Summary
protected  class RetransmissionQueueImpl.ResendCandidate
          Represents a candidate for resend, i.e.
static interface RetransmissionQueueImpl.Resender
          Encapsulates actual resend logic (pluggable to facilitate unit testing)
 
Field Summary
 
Fields inherited from interface org.apache.cxf.ws.rm.RetransmissionQueue
DEFAULT_BASE_RETRANSMISSION_INTERVAL, DEFAULT_EXPONENTIAL_BACKOFF
 
Constructor Summary
RetransmissionQueueImpl(RMManager m)
           
 
Method Summary
 void addUnacknowledged(Message message)
          Accepts a new message for possible future retransmission.
protected  RetransmissionQueueImpl.ResendCandidate cacheUnacknowledged(Message message)
          Accepts a new resend candidate.
 int countUnacknowledged(SourceSequence seq)
           
protected  RetransmissionQueueImpl.ResendCandidate createResendCandidate(Message message)
           
protected  JaxbAssertion<RMAssertion> getAssertion(AssertionInfo ai)
           
protected  RetransmissionQueueImpl.Resender getDefaultResender()
          Create default Resender logic.
protected  int getExponentialBackoff()
           
 RMManager getManager()
           
 RetransmissionStatus getRetransmissionStatus(SourceSequence seq, long num)
          Returns the retransmission status for the specified message.
 Map<Long,RetransmissionStatus> getRetransmissionStatuses(SourceSequence seq)
          Return the retransmission status of all the messages assigned to the sequence.
protected  List<RetransmissionQueueImpl.ResendCandidate> getSequenceCandidates(SourceSequence seq)
           
protected  List<RetransmissionQueueImpl.ResendCandidate> getSequenceCandidates(String key)
           
protected  Map<String,List<RetransmissionQueueImpl.ResendCandidate>> getUnacknowledged()
           
 List<Long> getUnacknowledgedMessageNumbers(SourceSequence seq)
           
 boolean isEmpty()
           
protected  boolean isSequenceSuspended(String key)
           
 void purgeAcknowledged(SourceSequence seq)
          Purge all candidates for the given sequence that have been acknowledged.
protected  void replaceResender(RetransmissionQueueImpl.Resender replacement)
          Plug in replacement resend logic (facilitates unit testing).
 void resume(SourceSequence seq)
          Resumes the retransmission attempts for the specified sequence
 void setManager(RMManager m)
           
 void start()
          Initiate resends.
 void stop(SourceSequence seq)
          Stops resending messages for the specified source sequence.
 void suspend(SourceSequence seq)
          Suspends the retransmission attempts for the specified sequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetransmissionQueueImpl

public RetransmissionQueueImpl(RMManager m)
Method Detail

getManager

public RMManager getManager()

setManager

public void setManager(RMManager m)

addUnacknowledged

public void addUnacknowledged(Message message)
Description copied from interface: RetransmissionQueue
Accepts a new message for possible future retransmission.

Specified by:
addUnacknowledged in interface RetransmissionQueue
Parameters:
message - the message context.

countUnacknowledged

public int countUnacknowledged(SourceSequence seq)
Specified by:
countUnacknowledged in interface RetransmissionQueue
Parameters:
seq - the sequence under consideration
Returns:
the number of unacknowledged messages for that sequence

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface RetransmissionQueue
Returns:
true if there are no unacknowledged messages in the queue

purgeAcknowledged

public void purgeAcknowledged(SourceSequence seq)
Purge all candidates for the given sequence that have been acknowledged.

Specified by:
purgeAcknowledged in interface RetransmissionQueue
Parameters:
seq - the sequence object.

getUnacknowledgedMessageNumbers

public List<Long> getUnacknowledgedMessageNumbers(SourceSequence seq)
Specified by:
getUnacknowledgedMessageNumbers in interface RetransmissionQueue
Returns:

getRetransmissionStatus

public RetransmissionStatus getRetransmissionStatus(SourceSequence seq,
                                                    long num)
Description copied from interface: RetransmissionQueue
Returns the retransmission status for the specified message.

Specified by:
getRetransmissionStatus in interface RetransmissionQueue
Returns:

getRetransmissionStatuses

public Map<Long,RetransmissionStatus> getRetransmissionStatuses(SourceSequence seq)
Description copied from interface: RetransmissionQueue
Return the retransmission status of all the messages assigned to the sequence.

Specified by:
getRetransmissionStatuses in interface RetransmissionQueue
Returns:

start

public void start()
Initiate resends.

Specified by:
start in interface RetransmissionQueue

stop

public void stop(SourceSequence seq)
Stops resending messages for the specified source sequence.

Specified by:
stop in interface RetransmissionQueue

suspend

public void suspend(SourceSequence seq)
Description copied from interface: RetransmissionQueue
Suspends the retransmission attempts for the specified sequence

Specified by:
suspend in interface RetransmissionQueue

resume

public void resume(SourceSequence seq)
Description copied from interface: RetransmissionQueue
Resumes the retransmission attempts for the specified sequence

Specified by:
resume in interface RetransmissionQueue

getExponentialBackoff

protected int getExponentialBackoff()
Returns:
the exponential backoff

createResendCandidate

protected RetransmissionQueueImpl.ResendCandidate createResendCandidate(Message message)
Parameters:
message - the message context
Returns:
a ResendCandidate

cacheUnacknowledged

protected RetransmissionQueueImpl.ResendCandidate cacheUnacknowledged(Message message)
Accepts a new resend candidate.

Parameters:
ctx - the message context.
Returns:
ResendCandidate

getUnacknowledged

protected Map<String,List<RetransmissionQueueImpl.ResendCandidate>> getUnacknowledged()
Returns:
a map relating sequence ID to a lists of un-acknowledged messages for that sequence

getSequenceCandidates

protected List<RetransmissionQueueImpl.ResendCandidate> getSequenceCandidates(SourceSequence seq)
Parameters:
seq - the sequence under consideration
Returns:
the list of resend candidates for that sequence

getSequenceCandidates

protected List<RetransmissionQueueImpl.ResendCandidate> getSequenceCandidates(String key)
Parameters:
key - the sequence identifier under consideration
Returns:
the list of resend candidates for that sequence

isSequenceSuspended

protected boolean isSequenceSuspended(String key)
Parameters:
key - the sequence identifier under consideration
Returns:
true if the sequence is currently suspended; false otherwise

getDefaultResender

protected final RetransmissionQueueImpl.Resender getDefaultResender()
Create default Resender logic.

Returns:
default Resender

replaceResender

protected void replaceResender(RetransmissionQueueImpl.Resender replacement)
Plug in replacement resend logic (facilitates unit testing).

Parameters:
replacement - resend logic

getAssertion

protected JaxbAssertion<RMAssertion> getAssertion(AssertionInfo ai)

Apache CXF API

Apache CXF