|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.util.ServiceSupport
org.apache.activemq.transport.TransportServerSupport
org.apache.activemq.transport.TransportServerThreadSupport
org.apache.activemq.transport.tcp.TcpTransportServer
public class TcpTransportServer
A TCP based implementation of TransportServer
Field Summary | |
---|---|
protected int |
backlog
|
protected int |
connectionTimeout
|
protected int |
currentTransportCount
|
protected boolean |
dynamicManagement
Specifies if the TransportLogger will be manageable by JMX or not. |
protected 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 ServerSocket |
serverSocket
|
protected ServerSocketFactory |
serverSocketFactory
|
protected int |
socketBufferSize
|
protected Thread |
socketHandlerThread
|
protected BlockingQueue<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 Map<String,Object> |
transportOptions
|
protected boolean |
useQueueForAccept
|
protected WireFormatFactory |
wireFormatFactory
|
Constructor Summary | |
---|---|
TcpTransportServer(TcpTransportFactory transportFactory,
URI location,
ServerSocketFactory serverSocketFactory)
|
Method Summary | |
---|---|
void |
bind()
|
protected Transport |
createTransport(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()
|
String |
getLogWriterName()
|
int |
getMaximumConnections()
|
long |
getMaxInactivityDuration()
|
long |
getMaxInactivityDurationInitalDelay()
|
int |
getMinmumWireFormatVersion()
|
InetSocketAddress |
getSocketAddress()
|
int |
getSocketBufferSize()
|
int |
getSoTimeout()
|
WireFormatFactory |
getWireFormatFactory()
|
protected void |
handleSocket(Socket socket)
|
boolean |
isDynamicManagement()
|
boolean |
isStartLogging()
|
boolean |
isTrace()
|
boolean |
isUseQueueForAccept()
|
protected String |
resolveHostName(ServerSocket socket,
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(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 |
setTransportOption(Map<String,Object> transportOptions)
|
void |
setUseQueueForAccept(boolean useQueueForAccept)
|
void |
setWireFormatFactory(WireFormatFactory wireFormatFactory)
|
void |
started(Service service)
|
void |
stopped(Service service)
|
String |
toString()
|
Methods inherited from class org.apache.activemq.transport.TransportServerThreadSupport |
---|
getStackSize, isDaemon, isJoinOnStop, setDaemon, setJoinOnStop, setStackSize |
Methods inherited from class org.apache.activemq.transport.TransportServerSupport |
---|
getAcceptListener, getBindLocation, getConnectURI, onAcceptError, setAcceptListener, setBindLocation, setConnectURI |
Methods inherited from class org.apache.activemq.util.ServiceSupport |
---|
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.activemq.Service |
---|
start, stop |
Field Detail |
---|
protected 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 String logWriterName
protected boolean dynamicManagement
protected boolean startLogging
protected Map<String,Object> transportOptions
protected final ServerSocketFactory serverSocketFactory
protected BlockingQueue<Socket> socketQueue
protected Thread socketHandlerThread
protected int maximumConnections
protected int currentTransportCount
Constructor Detail |
---|
public TcpTransportServer(TcpTransportFactory transportFactory, URI location, ServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException
IOException
URISyntaxException
Method Detail |
---|
public void bind() throws IOException
IOException
public WireFormatFactory getWireFormatFactory()
public void setWireFormatFactory(WireFormatFactory wireFormatFactory)
wireFormatFactory
- The wireFormatFactory to set.public void setBrokerInfo(BrokerInfo brokerInfo)
setBrokerInfo
in interface TransportServer
brokerInfo
- 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 String getLogWriterName()
public void setLogWriterName(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 Runnable
protected Transport createTransport(Socket socket, WireFormat format) throws IOException
socket
- format
-
IOException
public String toString()
toString
in class Object
protected String resolveHostName(ServerSocket socket, InetAddress bindAddress) throws UnknownHostException
socket
- inetAddress
-
UnknownHostException
protected void doStart() throws Exception
doStart
in class TransportServerThreadSupport
Exception
protected void doStop(ServiceStopper stopper) throws Exception
doStop
in class TransportServerThreadSupport
Exception
public InetSocketAddress getSocketAddress()
getSocketAddress
in interface TransportServer
public void setTransportOption(Map<String,Object> transportOptions)
protected final void handleSocket(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 ServiceListener
public void stopped(Service service)
stopped
in interface ServiceListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |