public abstract class AbstractNettyServer extends Object implements NettyServer
Server.TRANSMISSION_PROTOCOL, Server.TransmissionProtocol
Modifier and Type | Field and Description |
---|---|
static org.jboss.netty.channel.group.ChannelGroup |
ALL_CHANNELS |
protected GameAdminService |
gameAdminService |
private static org.slf4j.Logger |
LOG |
protected org.jboss.netty.channel.ChannelPipelineFactory |
pipelineFactory |
protected int |
portNumber |
protected org.jboss.netty.bootstrap.Bootstrap |
serverBootstrap |
protected Session |
session |
protected InetSocketAddress |
socketAddress |
Constructor and Description |
---|
AbstractNettyServer() |
Modifier and Type | Method and Description |
---|---|
void |
configureServerBootStrap(String[] optionsList)
If thread pools or TCP/IP parameters or the pipeline factory need to be
modified then it is this method that needs to be overriden.
|
GameAdminService |
getGameAdminService() |
org.jboss.netty.channel.ChannelPipelineFactory |
getPipelineFactory()
createServerBootstrap will create a pipeline factory and save it as a
class variable.
|
int |
getPortNumber() |
int |
getPortNumber(String[] args) |
org.jboss.netty.bootstrap.Bootstrap |
getServerBootstrap() |
Session |
getSession() |
InetSocketAddress |
getSocketAddress() |
void |
setGameAdminService(GameAdminService gameAdminService) |
void |
setInetAddress(InetSocketAddress inetAddress) |
void |
setPipelineFactory(org.jboss.netty.channel.ChannelPipelineFactory factory)
Method can be used to set the pipeline factory that is to be used by the
netty server.
|
void |
setPortNumber(int portNumber) |
void |
setServerBootstrap(org.jboss.netty.bootstrap.Bootstrap serverBootstrap)
Sets the server bootstrap, could be TCP, UDP bootstrap.
|
void |
setSession(Session session) |
void |
stopServer() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createServerBootstrap
getTransmissionProtocol, startServer, startServer, startServer
private static final org.slf4j.Logger LOG
public static final org.jboss.netty.channel.group.ChannelGroup ALL_CHANNELS
protected Session session
protected InetSocketAddress socketAddress
protected int portNumber
protected org.jboss.netty.bootstrap.Bootstrap serverBootstrap
protected org.jboss.netty.channel.ChannelPipelineFactory pipelineFactory
protected GameAdminService gameAdminService
public void stopServer() throws Exception
stopServer
in interface Server
Exception
public void configureServerBootStrap(String[] optionsList)
NettyServer
configureServerBootStrap
in interface NettyServer
optionsList
- Used to set tcp ip options like noDelay etc.public int getPortNumber(String[] args)
public org.jboss.netty.bootstrap.Bootstrap getServerBootstrap()
getServerBootstrap
in interface NettyServer
public void setServerBootstrap(org.jboss.netty.bootstrap.Bootstrap serverBootstrap)
NettyServer
setServerBootstrap
in interface NettyServer
public org.jboss.netty.channel.ChannelPipelineFactory getPipelineFactory()
NettyServer
getPipelineFactory
in interface NettyServer
public void setPipelineFactory(org.jboss.netty.channel.ChannelPipelineFactory factory)
NettyServer
setPipelineFactory
in interface NettyServer
factory
- The factory which will create a pipeline on each incoming
connection.public int getPortNumber()
public void setPortNumber(int portNumber)
public GameAdminService getGameAdminService()
public void setGameAdminService(GameAdminService gameAdminService)
public InetSocketAddress getSocketAddress()
getSocketAddress
in interface Server
public void setInetAddress(InetSocketAddress inetAddress)
public Session getSession()
getSession
in interface Server
public void setSession(Session session)
setSession
in interface Server
Copyright © 2013. All Rights Reserved.