@ChannelHandler.Sharable @StampyLibrary(libraryName="stampy-NETTY-client-server-RI") public abstract class StampyNettyChannelHandler extends org.jboss.netty.channel.SimpleChannelUpstreamHandler
| Constructor and Description |
|---|
StampyNettyChannelHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
asyncProcessing(HostPort hostPort,
java.lang.String msg)
Once simple validation has been performed on the received message a
Runnable is executed by a single thread executor.
|
void |
broadcastMessage(java.lang.String message)
Broadcast message.
|
void |
channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
Invoked when a
Channel is open, bound to a local address, and
connected to a remote address. |
void |
channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
Invoked when a
Channel was disconnected from its remote peer. |
void |
close(HostPort hostPort)
Close.
|
protected HostPort |
createHostPort(org.jboss.netty.channel.ChannelHandlerContext ctx)
Creates the host port.
|
void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e) |
java.util.Set<HostPort> |
getConnectedHostPorts()
Gets the connected host ports.
|
java.util.concurrent.Executor |
getExecutor()
Gets the executor.
|
AbstractStampyMessageGateway |
getGateway()
Gets the gateway.
|
StampyHeartbeatContainer |
getHeartbeatContainer()
Gets the heartbeat container.
|
StompMessageParser |
getParser()
Gets the parser.
|
UnparseableMessageHandler |
getUnparseableMessageHandler()
Gets the unparseable message handler.
|
protected void |
illegalAccess(org.jboss.netty.channel.ChannelHandlerContext ctx)
Illegal access.
|
boolean |
isConnected(HostPort hostPort)
Checks if is connected.
|
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e) |
void |
sendMessage(java.lang.String message,
HostPort hostPort)
Send message.
|
void |
setExecutor(java.util.concurrent.Executor executor)
Sets the executor.
|
void |
setGateway(AbstractStampyMessageGateway gateway)
Sets the gateway.
|
void |
setHeartbeatContainer(StampyHeartbeatContainer heartbeatContainer)
Sets the heartbeat container.
|
void |
setParser(StompMessageParser parser)
Sets the parser.
|
void |
setUnparseableMessageHandler(UnparseableMessageHandler unparseableMessageHandler)
Sets the unparseable message handler.
|
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e)
throws java.lang.Exception
messageReceived in class org.jboss.netty.channel.SimpleChannelUpstreamHandlerjava.lang.Exceptionprotected HostPort createHostPort(org.jboss.netty.channel.ChannelHandlerContext ctx)
ctx - the ctxpublic void channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
throws java.lang.Exception
Channel is open, bound to a local address, and
connected to a remote address. channelConnected in class org.jboss.netty.channel.SimpleChannelUpstreamHandlerctx - the ctxe - the ejava.lang.Exception - the exceptionpublic void channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
throws java.lang.Exception
Channel was disconnected from its remote peer.channelDisconnected in class org.jboss.netty.channel.SimpleChannelUpstreamHandlerctx - the ctxe - the ejava.lang.Exception - the exceptionpublic java.util.Set<HostPort> getConnectedHostPorts()
public boolean isConnected(HostPort hostPort)
hostPort - the host portpublic void broadcastMessage(java.lang.String message)
message - the messagepublic void sendMessage(java.lang.String message,
HostPort hostPort)
message - the messagehostPort - the host portpublic void close(HostPort hostPort)
hostPort - the host portprotected void asyncProcessing(HostPort hostPort, java.lang.String msg)
hostPort - the host portmsg - the msgprotected void illegalAccess(org.jboss.netty.channel.ChannelHandlerContext ctx)
ctx - the ctxpublic StompMessageParser getParser()
public void setParser(StompMessageParser parser)
parser - the new parserpublic StampyHeartbeatContainer getHeartbeatContainer()
public void setHeartbeatContainer(StampyHeartbeatContainer heartbeatContainer)
heartbeatContainer - the new heartbeat containerpublic AbstractStampyMessageGateway getGateway()
public void setGateway(AbstractStampyMessageGateway gateway)
gateway - the new gatewaypublic UnparseableMessageHandler getUnparseableMessageHandler()
public void setUnparseableMessageHandler(UnparseableMessageHandler unparseableMessageHandler)
unparseableMessageHandler - the new unparseable message handlerpublic void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e)
throws java.lang.Exception
exceptionCaught in class org.jboss.netty.channel.SimpleChannelUpstreamHandlerjava.lang.Exceptionpublic java.util.concurrent.Executor getExecutor()
public void setExecutor(java.util.concurrent.Executor executor)
executor - the new executor