@StampyLibrary(libraryName="stampy-client-server") public abstract class AbstractAcknowledgementListenerAndInterceptor<SVR extends AbstractStampyMessageGateway> extends AbstractOutgoingMessageInterceptor<SVR> implements StampyMessageListener
StompMessageType.MESSAGE
messages for a subscription. If confirmation of the publication is requested
a timer is created to await receipt of the confirmation, and the appropriate
methods of the StampyAcknowledgementHandler implementation are
invoked.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<HostPort,java.util.Queue<java.lang.String>> |
messages
The messages.
|
| Constructor and Description |
|---|
AbstractAcknowledgementListenerAndInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
ensureCleanup()
Configure the gateway to clean up the map of expected acks on session
termination.
|
long |
getAckTimeoutMillis()
Gets the ack timeout millis.
|
StampyAcknowledgementHandler |
getHandler()
Gets the handler.
|
StompMessageType[] |
getMessageTypes()
Gets the message types of which the implementation is interested.
|
void |
interceptMessage(StampyMessage<?> message,
HostPort hostPort)
Intercepts the outgoing message for capturing state etc, invoked by the.
|
boolean |
isForMessage(StampyMessage<?> message)
Returns true if the message should be processed by the implementation.
|
void |
messageReceived(StampyMessage<?> message,
HostPort hostPort)
Invoked when the type and the message are to be processed by the
implementation.
|
void |
setAckTimeoutMillis(long ackTimeoutMillis)
Sets the ack timeout millis.
|
void |
setGateway(SVR gateway)
Sets the gateway.
|
void |
setHandler(StampyAcknowledgementHandler handler)
Inject the
StampyAcknowledgementHandler implementation on system
startup. |
getGateway, interceptMessageprotected java.util.Map<HostPort,java.util.Queue<java.lang.String>> messages
public AbstractAcknowledgementListenerAndInterceptor()
public StompMessageType[] getMessageTypes()
StampyMessageListenergetMessageTypes in interface StampyMessageListenergetMessageTypes in interface StampyOutgoingMessageInterceptorpublic boolean isForMessage(StampyMessage<?> message)
StampyMessageListenerisForMessage in interface StampyMessageListenerisForMessage in interface StampyOutgoingMessageInterceptormessage - the messagepublic void messageReceived(StampyMessage<?> message, HostPort hostPort) throws java.lang.Exception
StampyMessageListenermessageReceived in interface StampyMessageListenermessage - the messagehostPort - the host portjava.lang.Exception - the exceptionpublic void interceptMessage(StampyMessage<?> message, HostPort hostPort) throws InterceptException
StampyOutgoingMessageInterceptorinterceptMessage in interface StampyOutgoingMessageInterceptormessage - the messagehostPort - the host portInterceptException - if the outgoing message is to be aborted
AbstractStampyMessageGatewayAbstractStampyMessageGatewaypublic long getAckTimeoutMillis()
public void setAckTimeoutMillis(long ackTimeoutMillis)
ackTimeoutMillis - the new ack timeout millispublic void setGateway(SVR gateway)
setGateway in class AbstractOutgoingMessageInterceptor<SVR extends AbstractStampyMessageGateway>gateway - the new gatewayprotected abstract void ensureCleanup()
public StampyAcknowledgementHandler getHandler()
public void setHandler(StampyAcknowledgementHandler handler)
StampyAcknowledgementHandler implementation on system
startup.handler - the new handler