|
||||||||||
| 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.TransportSupport
org.apache.activemq.transport.TransportThreadSupport
org.apache.activemq.transport.tcp.TcpTransport
public class TcpTransport
An implementation of the Transport interface using raw tcp/ip
| Field Summary | |
|---|---|
protected int |
connectionTimeout
|
protected java.io.DataInputStream |
dataIn
|
protected java.io.DataOutputStream |
dataOut
|
protected int |
ioBufferSize
|
protected java.net.URI |
localLocation
|
protected int |
minmumWireFormatVersion
|
protected java.net.URI |
remoteLocation
|
protected java.net.Socket |
socket
|
protected int |
socketBufferSize
|
protected javax.net.SocketFactory |
socketFactory
|
protected int |
soTimeout
|
protected boolean |
trace
|
protected boolean |
useLocalHost
|
protected WireFormat |
wireFormat
|
| Constructor Summary | |
|---|---|
TcpTransport(WireFormat wireFormat,
java.net.Socket socket)
Initialize from a server Socket |
|
TcpTransport(WireFormat wireFormat,
javax.net.SocketFactory socketFactory,
java.net.URI remoteLocation,
java.net.URI localLocation)
Connect to a remote Node - e.g. |
|
| Method Summary | |
|---|---|
protected void |
closeStreams()
|
protected void |
connect()
|
protected void |
doStart()
|
protected void |
doStop(ServiceStopper stopper)
|
int |
getConnectionTimeout()
|
int |
getIoBufferSize()
|
java.lang.Boolean |
getKeepAlive()
|
int |
getMinmumWireFormatVersion()
|
java.lang.String |
getRemoteAddress()
|
int |
getSocketBufferSize()
|
int |
getSoTimeout()
|
java.lang.Boolean |
getTcpNoDelay()
|
protected void |
initialiseSocket(java.net.Socket sock)
Configures the socket for use |
protected void |
initializeStreams()
|
boolean |
isTrace()
|
boolean |
isUseLocalHost()
|
void |
oneway(java.lang.Object command)
A one way asynchronous send |
protected java.lang.Object |
readCommand()
|
protected java.lang.String |
resolveHostName(java.lang.String host)
|
void |
run()
reads packets from a Socket |
void |
setConnectionTimeout(int connectionTimeout)
Sets the timeout used to connect to the socket |
void |
setIoBufferSize(int ioBufferSize)
|
void |
setKeepAlive(java.lang.Boolean keepAlive)
Enable/disable TCP KEEP_ALIVE mode |
void |
setMinmumWireFormatVersion(int minmumWireFormatVersion)
|
void |
setSocketBufferSize(int socketBufferSize)
Sets the buffer size to use on the socket |
void |
setSocketOptions(java.util.Map socketOptions)
|
void |
setSoTimeout(int soTimeout)
Sets the socket timeout |
void |
setTcpNoDelay(java.lang.Boolean tcpNoDelay)
Enable/disable the TCP_NODELAY option on the socket |
void |
setTrace(boolean trace)
|
void |
setUseLocalHost(boolean useLocalHost)
Sets whether 'localhost' or the actual local host name should be used to make local connections. |
java.lang.String |
toString()
|
| Methods inherited from class org.apache.activemq.transport.TransportThreadSupport |
|---|
isDaemon, setDaemon |
| Methods inherited from class org.apache.activemq.transport.TransportSupport |
|---|
asyncRequest, checkStarted, doConsume, getTransportListener, narrow, onException, request, request, setTransportListener |
| Methods inherited from class org.apache.activemq.util.ServiceSupport |
|---|
dispose, isStarted, isStopped, isStopping, 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.transport.Transport |
|---|
asyncRequest, getTransportListener, narrow, request, request, setTransportListener |
| Methods inherited from interface org.apache.activemq.Service |
|---|
start, stop |
| Field Detail |
|---|
protected final java.net.URI remoteLocation
protected final java.net.URI localLocation
protected final WireFormat wireFormat
protected int connectionTimeout
protected int soTimeout
protected int socketBufferSize
protected int ioBufferSize
protected java.net.Socket socket
protected java.io.DataOutputStream dataOut
protected java.io.DataInputStream dataIn
protected boolean trace
protected boolean useLocalHost
protected int minmumWireFormatVersion
protected javax.net.SocketFactory socketFactory
| Constructor Detail |
|---|
public TcpTransport(WireFormat wireFormat,
javax.net.SocketFactory socketFactory,
java.net.URI remoteLocation,
java.net.URI localLocation)
throws java.net.UnknownHostException,
java.io.IOException
wireFormat - socketFactory - remoteLocation - localLocation - -
e.g. local InetAddress and local port
java.io.IOException
java.net.UnknownHostException
public TcpTransport(WireFormat wireFormat,
java.net.Socket socket)
throws java.io.IOException
wireFormat - socket -
java.io.IOException| Method Detail |
|---|
public void oneway(java.lang.Object command)
throws java.io.IOException
oneway in interface Transportjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void run()
run in interface java.lang.Runnable
protected java.lang.Object readCommand()
throws java.io.IOException
java.io.IOExceptionpublic boolean isTrace()
public void setTrace(boolean trace)
public int getMinmumWireFormatVersion()
public void setMinmumWireFormatVersion(int minmumWireFormatVersion)
public boolean isUseLocalHost()
public void setUseLocalHost(boolean useLocalHost)
public int getSocketBufferSize()
public void setSocketBufferSize(int socketBufferSize)
public int getSoTimeout()
public void setSoTimeout(int soTimeout)
public int getConnectionTimeout()
public void setConnectionTimeout(int connectionTimeout)
public java.lang.Boolean getKeepAlive()
public void setKeepAlive(java.lang.Boolean keepAlive)
public java.lang.Boolean getTcpNoDelay()
public void setTcpNoDelay(java.lang.Boolean tcpNoDelay)
public int getIoBufferSize()
public void setIoBufferSize(int ioBufferSize)
ioBufferSize - the ioBufferSize to set
protected java.lang.String resolveHostName(java.lang.String host)
throws java.net.UnknownHostException
java.net.UnknownHostException
protected void initialiseSocket(java.net.Socket sock)
throws java.net.SocketException
sock -
java.net.SocketException
protected void doStart()
throws java.lang.Exception
doStart in class TransportThreadSupportjava.lang.Exception
protected void connect()
throws java.lang.Exception
java.lang.Exception
protected void doStop(ServiceStopper stopper)
throws java.lang.Exception
doStop in class ServiceSupportjava.lang.Exception
protected void initializeStreams()
throws java.lang.Exception
java.lang.Exception
protected void closeStreams()
throws java.io.IOException
java.io.IOExceptionpublic void setSocketOptions(java.util.Map socketOptions)
public java.lang.String getRemoteAddress()
getRemoteAddress in interface Transport
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||