@StampyLibrary(libraryName="stampy-client-server") public abstract class AbstractLoginMessageListener<SVR extends AbstractStampyMessageGateway> extends java.lang.Object implements StampyMessageListener
StampyLoginHandler. Should the login handler throw a
TerminateSessionException this class will send an error to the
client, close the session and throw a MessageListenerHaltException to
prevent downstream processing of the message by the remaining
StampyMessageListeners.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Queue<HostPort> |
loggedInConnections
The logged in connections.
|
| Constructor and Description |
|---|
AbstractLoginMessageListener() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
ensureCleanup()
Configure the gateway to clean up the queue of logged in connections on
session termination.
|
SVR |
getGateway()
Gets the gateway.
|
StampyLoginHandler |
getLoginHandler()
Gets the login handler.
|
StompMessageType[] |
getMessageTypes()
Gets the message types of which the implementation is interested.
|
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 |
setGateway(SVR gateway)
Inject the
AbstractStampyMessageGateway on system startup. |
void |
setLoginHandler(StampyLoginHandler loginHandler)
Inject the implementation of
StampyLoginHandler on system startup. |
protected java.util.Queue<HostPort> loggedInConnections
public StompMessageType[] getMessageTypes()
StampyMessageListenergetMessageTypes in interface StampyMessageListenerpublic boolean isForMessage(StampyMessage<?> message)
StampyMessageListenerisForMessage in interface StampyMessageListenermessage - 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 StampyLoginHandler getLoginHandler()
public void setLoginHandler(StampyLoginHandler loginHandler)
StampyLoginHandler on system startup.loginHandler - the new login handlerpublic SVR getGateway()
public void setGateway(SVR gateway)
AbstractStampyMessageGateway on system startup.gateway - the new gatewayprotected abstract void ensureCleanup()