@StampyLibrary(libraryName="stampy-client-server") public abstract class AbstractDisconnectListenerAndInterceptor<CLNT extends AbstractStampyMessageGateway> extends AbstractOutgoingMessageInterceptor<CLNT> implements StampyMessageListener
StompMessageType.DISCONNECT message
if a receipt has been requested. When the receipt from the server arrives the
isCloseOnDisconnectMessage()
is evaluated and if true the session is closed.| Constructor and Description |
|---|
AbstractDisconnectListenerAndInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
StompMessageType[] |
getMessageTypes()
Gets the message types of which the implementation is interested.
|
java.lang.String |
getReceiptId()
Gets the receipt id.
|
void |
interceptMessage(StampyMessage<?> message,
HostPort hostPort)
Intercepts the outgoing message for capturing state etc, invoked by the.
|
boolean |
isCloseOnDisconnectMessage()
Checks if is close on disconnect message.
|
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 |
setCloseOnDisconnectMessage(boolean closeOnDisconnectMessage)
Inject the desired behaviour on system startup.
|
void |
setReceiptId(java.lang.String receiptId)
Sets the receipt id.
|
getGateway, interceptMessage, setGatewaypublic AbstractDisconnectListenerAndInterceptor()
public StompMessageType[] getMessageTypes()
StampyMessageListenergetMessageTypes in interface StampyMessageListenergetMessageTypes in interface StampyOutgoingMessageInterceptorpublic boolean isForMessage(StampyMessage<?> message)
StampyMessageListenerisForMessage in interface StampyMessageListenerisForMessage in interface StampyOutgoingMessageInterceptormessage - the messagepublic 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 void messageReceived(StampyMessage<?> message, HostPort hostPort) throws java.lang.Exception
StampyMessageListenermessageReceived in interface StampyMessageListenermessage - the messagehostPort - the host portjava.lang.Exception - the exceptionpublic boolean isCloseOnDisconnectMessage()
public void setCloseOnDisconnectMessage(boolean closeOnDisconnectMessage)
closeOnDisconnectMessage - the new close on disconnect messagepublic java.lang.String getReceiptId()
public void setReceiptId(java.lang.String receiptId)
receiptId - the new receipt id