E - enum representing the event typeAMCS - the AbstractMultiConnectionSocket implementationMCSR - the MultiConnectionSubscriptionRequestpublic abstract class AbstractSubscriptionHandlerAdapter<E extends java.lang.Enum<E>,AMCS extends AbstractMultiConnectionSocket<?>,MCSR extends MultiConnectionSubscriptionRequest<E>>
extends org.apache.mina.core.service.IoHandlerAdapter
IoHandler implementation to receive subscriptions and
publish AbstractMultiConnectionEvents on a socket.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSubscriptionHandlerAdapter(AMCS socket)
Instantiates a new abstract subscription handler adapter.
|
| Modifier and Type | Method and Description |
|---|---|
protected HostPort |
createHostPort(org.apache.mina.core.session.IoSession session)
Creates the host port.
|
AMCS |
getSocket()
Gets the socket.
|
abstract void |
messageReceived(org.apache.mina.core.session.IoSession session,
java.lang.Object message)
Implement to deal with subscription requests & any other message types the
subclass must deal with.
|
void |
sendMultiConnectionEvent(AbstractMultiConnectionEvent<E> event)
Sends the specified
AbstractMultiConnectionEvent to all interested
subscribers. |
void |
sessionClosed(org.apache.mina.core.session.IoSession session) |
protected void |
setSocket(AMCS socket)
Sets the socket.
|
protected void |
subscribe(org.apache.mina.core.session.IoSession session,
MCSR message)
Subscribe.
|
protected AbstractSubscriptionHandlerAdapter(AMCS socket)
socket - the socketpublic abstract void messageReceived(org.apache.mina.core.session.IoSession session,
java.lang.Object message)
throws java.lang.Exception
messageReceived in interface org.apache.mina.core.service.IoHandlermessageReceived in class org.apache.mina.core.service.IoHandlerAdaptersession - the sessionmessage - the messagejava.lang.Exception - the exceptionsubscribe(IoSession,
MultiConnectionSubscriptionRequest)public void sessionClosed(org.apache.mina.core.session.IoSession session)
throws java.lang.Exception
sessionClosed in interface org.apache.mina.core.service.IoHandlersessionClosed in class org.apache.mina.core.service.IoHandlerAdapterjava.lang.Exceptionpublic void sendMultiConnectionEvent(AbstractMultiConnectionEvent<E> event)
AbstractMultiConnectionEvent to all interested
subscribers.event - the eventAbstractMultiConnectionSocket,
AbstractSocketConnectorprotected void subscribe(org.apache.mina.core.session.IoSession session,
MCSR message)
session - the sessionmessage - the messagepublic AMCS getSocket()
protected void setSocket(AMCS socket)
socket - the new socketprotected HostPort createHostPort(org.apache.mina.core.session.IoSession session)
session - the session