public class RetransmissionQueueImpl extends Object implements RetransmissionQueue
Modifier and Type | Class and Description |
---|---|
static class |
RetransmissionQueueImpl.CopyOutInterceptor |
protected class |
RetransmissionQueueImpl.ResendCandidate
Represents a candidate for resend, i.e.
|
static interface |
RetransmissionQueueImpl.Resender
Encapsulates actual resend logic (pluggable to facilitate unit testing)
|
DEFAULT_BASE_RETRANSMISSION_INTERVAL, DEFAULT_EXPONENTIAL_BACKOFF
Constructor and Description |
---|
RetransmissionQueueImpl(RMManager m) |
Modifier and Type | Method and Description |
---|---|
void |
addUnacknowledged(Message message)
Accepts a new message for possible future retransmission.
|
protected Conduit |
buildConduit(SoapMessage message,
Endpoint endpoint,
org.apache.cxf.ws.addressing.AttributedURIType to) |
protected PhaseInterceptorChain |
buildRetransmitChain(Endpoint endpoint,
PhaseChainCache cache) |
protected RetransmissionQueueImpl.ResendCandidate |
cacheUnacknowledged(Message message)
Accepts a new resend candidate.
|
int |
countUnacknowledged() |
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() |
RetryStatus |
getRetransmissionStatus(SourceSequence seq,
long num)
Returns the retransmission status for the specified message.
|
Map<Long,RetryStatus> |
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.
|
void |
purgeAll(SourceSequence seq)
Purge all candidates for the given sequence.
|
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
|
public RetransmissionQueueImpl(RMManager m)
public RMManager getManager()
public void setManager(RMManager m)
public void addUnacknowledged(Message message)
RetransmissionQueue
addUnacknowledged
in interface RetransmissionQueue
message
- the message context.public int countUnacknowledged(SourceSequence seq)
countUnacknowledged
in interface RetransmissionQueue
seq
- the sequence under considerationpublic int countUnacknowledged()
countUnacknowledged
in interface RetransmissionQueue
public boolean isEmpty()
isEmpty
in interface RetransmissionQueue
public void purgeAcknowledged(SourceSequence seq)
purgeAcknowledged
in interface RetransmissionQueue
seq
- the sequence object.public void purgeAll(SourceSequence seq)
purgeAll
in interface RetransmissionQueue
seq
- the sequence object.public List<Long> getUnacknowledgedMessageNumbers(SourceSequence seq)
getUnacknowledgedMessageNumbers
in interface RetransmissionQueue
public RetryStatus getRetransmissionStatus(SourceSequence seq, long num)
RetransmissionQueue
getRetransmissionStatus
in interface RetransmissionQueue
public Map<Long,RetryStatus> getRetransmissionStatuses(SourceSequence seq)
RetransmissionQueue
getRetransmissionStatuses
in interface RetransmissionQueue
public void start()
start
in interface RetransmissionQueue
public void stop(SourceSequence seq)
stop
in interface RetransmissionQueue
public void suspend(SourceSequence seq)
RetransmissionQueue
suspend
in interface RetransmissionQueue
public void resume(SourceSequence seq)
RetransmissionQueue
resume
in interface RetransmissionQueue
protected int getExponentialBackoff()
protected RetransmissionQueueImpl.ResendCandidate createResendCandidate(Message message)
message
- the message contextprotected RetransmissionQueueImpl.ResendCandidate cacheUnacknowledged(Message message)
message
- the message object.protected Map<String,List<RetransmissionQueueImpl.ResendCandidate>> getUnacknowledged()
protected List<RetransmissionQueueImpl.ResendCandidate> getSequenceCandidates(SourceSequence seq)
seq
- the sequence under considerationprotected List<RetransmissionQueueImpl.ResendCandidate> getSequenceCandidates(String key)
key
- the sequence identifier under considerationprotected boolean isSequenceSuspended(String key)
key
- the sequence identifier under considerationprotected final RetransmissionQueueImpl.Resender getDefaultResender()
protected void replaceResender(RetransmissionQueueImpl.Resender replacement)
replacement
- resend logicprotected JaxbAssertion<RMAssertion> getAssertion(AssertionInfo ai)
protected Conduit buildConduit(SoapMessage message, Endpoint endpoint, org.apache.cxf.ws.addressing.AttributedURIType to)
message
- endpoint
- to
- protected PhaseInterceptorChain buildRetransmitChain(Endpoint endpoint, PhaseChainCache cache)
endpoint
- cache
- Apache CXF