public class TcpTransportServer extends TransportServerThreadSupport implements ServiceListener
TransportServer| Modifier and Type | Field and Description |
|---|---|
protected int |
backlog |
protected int |
connectionTimeout |
protected int |
currentTransportCount |
protected boolean |
dynamicManagement
Specifies if the TransportLogger will be manageable by JMX or not.
|
protected java.lang.String |
logWriterName
Name of the LogWriter implementation to use.
|
protected int |
maximumConnections
The maximum number of sockets allowed for this server
|
protected long |
maxInactivityDuration |
protected long |
maxInactivityDurationInitalDelay |
protected int |
minmumWireFormatVersion |
protected java.net.ServerSocket |
serverSocket |
protected javax.net.ServerSocketFactory |
serverSocketFactory |
protected int |
socketBufferSize |
protected java.lang.Thread |
socketHandlerThread |
protected java.util.concurrent.BlockingQueue<java.net.Socket> |
socketQueue |
protected int |
soTimeout |
protected boolean |
startLogging
startLogging=true -> the TransportLogger object of the Transport stack
will initially write messages to the log.
|
protected boolean |
trace
trace=true -> the Transport stack where this TcpTransport
object will be, will have a TransportLogger layer
trace=false -> the Transport stack where this TcpTransport
object will be, will NOT have a TransportLogger layer, and therefore
will never be able to print logging messages.
|
protected TcpTransportFactory |
transportFactory |
protected boolean |
useQueueForAccept |
protected WireFormatFactory |
wireFormatFactory |
transportOptions| Constructor and Description |
|---|
TcpTransportServer(TcpTransportFactory transportFactory,
java.net.URI location,
javax.net.ServerSocketFactory serverSocketFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind() |
protected Transport |
createTransport(java.net.Socket socket,
WireFormat format)
Allow derived classes to override the Transport implementation that this
transport server creates.
|
protected void |
doStart() |
protected void |
doStop(ServiceStopper stopper) |
int |
getBacklog() |
int |
getConnectionTimeout() |
java.lang.String |
getLogWriterName() |
int |
getMaximumConnections() |
long |
getMaxInactivityDuration() |
long |
getMaxInactivityDurationInitalDelay() |
int |
getMinmumWireFormatVersion() |
java.net.InetSocketAddress |
getSocketAddress() |
int |
getSocketBufferSize() |
int |
getSoTimeout() |
WireFormatFactory |
getWireFormatFactory() |
protected void |
handleSocket(java.net.Socket socket) |
boolean |
isDynamicManagement() |
boolean |
isStartLogging() |
boolean |
isTrace() |
boolean |
isUseQueueForAccept() |
protected java.lang.String |
resolveHostName(java.net.ServerSocket socket,
java.net.InetAddress bindAddress) |
void |
run()
pull Sockets from the ServerSocket
|
void |
setBacklog(int backlog) |
void |
setBrokerInfo(BrokerInfo brokerInfo)
Associates a broker info with the transport server so that the transport
can do discovery advertisements of the broker.
|
void |
setConnectionTimeout(int connectionTimeout) |
void |
setDynamicManagement(boolean useJmx) |
void |
setLogWriterName(java.lang.String logFormat) |
void |
setMaximumConnections(int maximumConnections) |
void |
setMaxInactivityDuration(long maxInactivityDuration) |
void |
setMaxInactivityDurationInitalDelay(long maxInactivityDurationInitalDelay) |
void |
setMinmumWireFormatVersion(int minmumWireFormatVersion) |
void |
setSocketBufferSize(int socketBufferSize) |
void |
setSoTimeout(int soTimeout) |
void |
setStartLogging(boolean startLogging) |
void |
setTrace(boolean trace) |
void |
setUseQueueForAccept(boolean useQueueForAccept) |
void |
setWireFormatFactory(WireFormatFactory wireFormatFactory) |
void |
started(Service service) |
void |
stopped(Service service) |
java.lang.String |
toString() |
getStackSize, isDaemon, isJoinOnStop, setDaemon, setJoinOnStop, setStackSizegetAcceptListener, getBindLocation, getConnectURI, onAcceptError, setAcceptListener, setBindLocation, setConnectURI, setTransportOptionaddServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stopprotected java.net.ServerSocket serverSocket
protected int backlog
protected WireFormatFactory wireFormatFactory
protected final TcpTransportFactory transportFactory
protected long maxInactivityDuration
protected long maxInactivityDurationInitalDelay
protected int minmumWireFormatVersion
protected boolean useQueueForAccept
protected boolean trace
protected int soTimeout
protected int socketBufferSize
protected int connectionTimeout
protected java.lang.String logWriterName
protected boolean dynamicManagement
protected boolean startLogging
protected final javax.net.ServerSocketFactory serverSocketFactory
protected java.util.concurrent.BlockingQueue<java.net.Socket> socketQueue
protected java.lang.Thread socketHandlerThread
protected int maximumConnections
protected int currentTransportCount
public TcpTransportServer(TcpTransportFactory transportFactory, java.net.URI location, javax.net.ServerSocketFactory serverSocketFactory) throws java.io.IOException, java.net.URISyntaxException
java.io.IOExceptionjava.net.URISyntaxExceptionpublic void bind() throws java.io.IOException
java.io.IOExceptionpublic WireFormatFactory getWireFormatFactory()
public void setWireFormatFactory(WireFormatFactory wireFormatFactory)
wireFormatFactory - The wireFormatFactory to set.public void setBrokerInfo(BrokerInfo brokerInfo)
setBrokerInfo in interface TransportServerbrokerInfo - public long getMaxInactivityDuration()
public void setMaxInactivityDuration(long maxInactivityDuration)
public long getMaxInactivityDurationInitalDelay()
public void setMaxInactivityDurationInitalDelay(long maxInactivityDurationInitalDelay)
public int getMinmumWireFormatVersion()
public void setMinmumWireFormatVersion(int minmumWireFormatVersion)
public boolean isTrace()
public void setTrace(boolean trace)
public java.lang.String getLogWriterName()
public void setLogWriterName(java.lang.String logFormat)
public boolean isDynamicManagement()
public void setDynamicManagement(boolean useJmx)
public boolean isStartLogging()
public void setStartLogging(boolean startLogging)
public int getBacklog()
public void setBacklog(int backlog)
backlog - the backlog to setpublic boolean isUseQueueForAccept()
public void setUseQueueForAccept(boolean useQueueForAccept)
useQueueForAccept - the useQueueForAccept to setpublic void run()
run in interface java.lang.Runnableprotected Transport createTransport(java.net.Socket socket, WireFormat format) throws java.io.IOException
socket - format - java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String resolveHostName(java.net.ServerSocket socket, java.net.InetAddress bindAddress) throws java.net.UnknownHostException
socket - inetAddress - java.net.UnknownHostExceptionprotected void doStart() throws java.lang.Exception
doStart in class TransportServerThreadSupportjava.lang.Exceptionprotected void doStop(ServiceStopper stopper) throws java.lang.Exception
doStop in class TransportServerThreadSupportjava.lang.Exceptionpublic java.net.InetSocketAddress getSocketAddress()
getSocketAddress in interface TransportServerprotected final void handleSocket(java.net.Socket socket)
public int getSoTimeout()
public void setSoTimeout(int soTimeout)
public int getSocketBufferSize()
public void setSocketBufferSize(int socketBufferSize)
public int getConnectionTimeout()
public void setConnectionTimeout(int connectionTimeout)
public int getMaximumConnections()
public void setMaximumConnections(int maximumConnections)
maximumConnections - the maximumConnections to setpublic void started(Service service)
started in interface ServiceListenerpublic void stopped(Service service)
stopped in interface ServiceListenerCopyright © 2005-2012. All Rights Reserved.