public abstract class Server<T,R> extends org.jboss.netty.channel.SimpleChannelHandler implements org.jboss.netty.channel.ChannelPipelineFactory, org.neo4j.kernel.lifecycle.Lifecycle, ChannelCloser
clients. Delegates actual work to an instance
of a specified communication interface, injected in the constructor.
frameLength vs. chunkSize: frameLength is the maximum and hardcoded size in each
Netty buffer created by this server and handed off to a Client. If the
client has got a smaller frameLength than this server it will fail on reading a frame
that is bigger than what its frameLength.
chunkSize is the max size a buffer will have before it's sent off and a new buffer
allocated to continue writing to.
frameLength should be a constant for an implementation and must have the same value
on server as well as clients connecting to that server, whereas chunkSize very well
can be configurable and vary between server and client.
Client| Modifier and Type | Class and Description |
|---|---|
static interface |
Server.Configuration |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_NUMBER_OF_CONCURRENT_TRANSACTIONS |
| Constructor and Description |
|---|
Server(T requestTarget,
Server.Configuration config,
org.neo4j.logging.LogProvider logProvider,
int frameLength,
ProtocolVersion protocolVersion,
TxChecksumVerifier txVerifier,
Clock clock,
org.neo4j.kernel.monitoring.ByteCounterMonitor byteCounterMonitor,
RequestMonitor requestMonitor) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e) |
void |
channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e) |
void |
channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e) |
void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e) |
org.jboss.netty.channel.ChannelPipeline |
getPipeline() |
InetSocketAddress |
getSocketAddress() |
void |
init() |
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent event) |
void |
shutdown() |
void |
start() |
void |
stop() |
void |
tryToCloseChannel(org.jboss.netty.channel.Channel channel) |
void |
writeComplete(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.WriteCompletionEvent e) |
bindRequested, channelBound, channelConnected, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, handleDownstream, handleUpstream, setInterestOpsRequested, unbindRequested, writeRequestedpublic static final int DEFAULT_MAX_NUMBER_OF_CONCURRENT_TRANSACTIONS
public Server(T requestTarget, Server.Configuration config, org.neo4j.logging.LogProvider logProvider, int frameLength, ProtocolVersion protocolVersion, TxChecksumVerifier txVerifier, Clock clock, org.neo4j.kernel.monitoring.ByteCounterMonitor byteCounterMonitor, RequestMonitor requestMonitor)
public void init()
throws Throwable
init in interface org.neo4j.kernel.lifecycle.LifecycleThrowablepublic void start()
throws Throwable
start in interface org.neo4j.kernel.lifecycle.LifecycleThrowablepublic void stop()
throws Throwable
stop in interface org.neo4j.kernel.lifecycle.LifecycleThrowablepublic void shutdown()
throws Throwable
shutdown in interface org.neo4j.kernel.lifecycle.LifecycleThrowablepublic InetSocketAddress getSocketAddress()
public org.jboss.netty.channel.ChannelPipeline getPipeline()
throws Exception
getPipeline in interface org.jboss.netty.channel.ChannelPipelineFactoryExceptionpublic void channelOpen(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
throws Exception
channelOpen in class org.jboss.netty.channel.SimpleChannelHandlerExceptionpublic void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent event)
throws Exception
messageReceived in class org.jboss.netty.channel.SimpleChannelHandlerExceptionpublic void writeComplete(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.WriteCompletionEvent e)
throws Exception
writeComplete in class org.jboss.netty.channel.SimpleChannelHandlerExceptionpublic void channelClosed(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
throws Exception
channelClosed in class org.jboss.netty.channel.SimpleChannelHandlerExceptionpublic void channelDisconnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e)
throws Exception
channelDisconnected in class org.jboss.netty.channel.SimpleChannelHandlerExceptionpublic void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e)
throws Exception
exceptionCaught in class org.jboss.netty.channel.SimpleChannelHandlerExceptionpublic void tryToCloseChannel(org.jboss.netty.channel.Channel channel)
tryToCloseChannel in interface ChannelCloserCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.