Package org.apache.cxf.ws.rm.soap
Class RetransmissionQueueImpl
java.lang.Object
org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl
- All Implemented Interfaces:
RetransmissionQueue
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprotected classRepresents a candidate for resend, i.e.static interfaceEncapsulates 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUnacknowledged(org.apache.cxf.message.Message message) Accepts a new message for possible future retransmission.protected org.apache.cxf.transport.ConduitbuildConduit(org.apache.cxf.binding.soap.SoapMessage message, org.apache.cxf.endpoint.Endpoint endpoint, org.apache.cxf.ws.addressing.AttributedURIType to) protected org.apache.cxf.phase.PhaseInterceptorChainbuildRetransmitChain(org.apache.cxf.endpoint.Endpoint endpoint, org.apache.cxf.phase.PhaseChainCache cache) protected RetransmissionQueueImpl.ResendCandidatecacheUnacknowledged(org.apache.cxf.message.Message message) Accepts a new resend candidate.intintprotected RetransmissionQueueImpl.ResendCandidatecreateResendCandidate(org.apache.cxf.message.Message message) protected org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion<RMAssertion>getAssertion(org.apache.cxf.ws.policy.AssertionInfo ai) protected final RetransmissionQueueImpl.ResenderCreate default Resender logic.protected intgetRetransmissionStatus(SourceSequence seq, long num) Returns the retransmission status for the specified message.Return the retransmission status of all the messages assigned to the sequence.protected List<RetransmissionQueueImpl.ResendCandidate>protected List<RetransmissionQueueImpl.ResendCandidate>protected Map<String,List<RetransmissionQueueImpl.ResendCandidate>> booleanisEmpty()protected booleanvoidPurge all candidates for the given sequence that have been acknowledged.voidpurgeAll(SourceSequence seq) Purge all candidates for the given sequence.protected voidreplaceResender(RetransmissionQueueImpl.Resender replacement) Plug in replacement resend logic (facilitates unit testing).voidresume(SourceSequence seq) Resumes the retransmission attempts for the specified sequencevoidvoidstart()Initiate resends.voidstop(SourceSequence seq) Stops resending messages for the specified source sequence.voidsuspend(SourceSequence seq) Suspends the retransmission attempts for the specified sequence
-
Constructor Details
-
RetransmissionQueueImpl
-
-
Method Details
-
getManager
-
setManager
-
addUnacknowledged
public void addUnacknowledged(org.apache.cxf.message.Message message) Description copied from interface:RetransmissionQueueAccepts a new message for possible future retransmission. Implementations must call the RMEndpoint.handleAccepted() method for each accepted message.- Specified by:
addUnacknowledgedin interfaceRetransmissionQueue- Parameters:
message- the message context.
-
countUnacknowledged
- Specified by:
countUnacknowledgedin interfaceRetransmissionQueue- Parameters:
seq- the sequence under consideration- Returns:
- the number of unacknowledged messages for that sequence
-
countUnacknowledged
public int countUnacknowledged()- Specified by:
countUnacknowledgedin interfaceRetransmissionQueue- Returns:
- the total number of unacknowledged messages in this queue
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceRetransmissionQueue- Returns:
- true if there are no unacknowledged messages in the queue
-
purgeAcknowledged
Purge all candidates for the given sequence that have been acknowledged.- Specified by:
purgeAcknowledgedin interfaceRetransmissionQueue- Parameters:
seq- the sequence object.
-
purgeAll
Purge all candidates for the given sequence. This method is used to terminate the sequence by force and release the resource associated with the sequence.- Specified by:
purgeAllin interfaceRetransmissionQueue- Parameters:
seq- the sequence object.
-
getUnacknowledgedMessageNumbers
- Specified by:
getUnacknowledgedMessageNumbersin interfaceRetransmissionQueue- Returns:
-
getRetransmissionStatus
Description copied from interface:RetransmissionQueueReturns the retransmission status for the specified message.- Specified by:
getRetransmissionStatusin interfaceRetransmissionQueue- Returns:
-
getRetransmissionStatuses
Description copied from interface:RetransmissionQueueReturn the retransmission status of all the messages assigned to the sequence.- Specified by:
getRetransmissionStatusesin interfaceRetransmissionQueue- Returns:
-
start
public void start()Initiate resends.- Specified by:
startin interfaceRetransmissionQueue
-
stop
Stops resending messages for the specified source sequence.- Specified by:
stopin interfaceRetransmissionQueue
-
suspend
Description copied from interface:RetransmissionQueueSuspends the retransmission attempts for the specified sequence- Specified by:
suspendin interfaceRetransmissionQueue
-
resume
Description copied from interface:RetransmissionQueueResumes the retransmission attempts for the specified sequence- Specified by:
resumein interfaceRetransmissionQueue
-
getExponentialBackoff
protected int getExponentialBackoff()- Returns:
- the exponential backoff
-
createResendCandidate
protected RetransmissionQueueImpl.ResendCandidate createResendCandidate(org.apache.cxf.message.Message message) - Parameters:
message- the message context- Returns:
- a ResendCandidate
-
cacheUnacknowledged
protected RetransmissionQueueImpl.ResendCandidate cacheUnacknowledged(org.apache.cxf.message.Message message) Accepts a new resend candidate.- Parameters:
message- the message object.- Returns:
- ResendCandidate
-
getUnacknowledged
- Returns:
- a map relating sequence ID to a lists of un-acknowledged messages for that sequence
-
getSequenceCandidates
- Parameters:
seq- the sequence under consideration- Returns:
- the list of resend candidates for that sequence
-
getSequenceCandidates
- Parameters:
key- the sequence identifier under consideration- Returns:
- the list of resend candidates for that sequence
-
isSequenceSuspended
- Parameters:
key- the sequence identifier under consideration- Returns:
- true if the sequence is currently suspended; false otherwise
-
getDefaultResender
Create default Resender logic.- Returns:
- default Resender
-
replaceResender
Plug in replacement resend logic (facilitates unit testing).- Parameters:
replacement- resend logic
-
getAssertion
protected org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion<RMAssertion> getAssertion(org.apache.cxf.ws.policy.AssertionInfo ai) -
buildConduit
protected org.apache.cxf.transport.Conduit buildConduit(org.apache.cxf.binding.soap.SoapMessage message, org.apache.cxf.endpoint.Endpoint endpoint, org.apache.cxf.ws.addressing.AttributedURIType to) - Parameters:
message-endpoint-to-- Returns:
-
buildRetransmitChain
protected org.apache.cxf.phase.PhaseInterceptorChain buildRetransmitChain(org.apache.cxf.endpoint.Endpoint endpoint, org.apache.cxf.phase.PhaseChainCache cache) - Parameters:
endpoint-cache-- Returns:
-