|
||||||||||
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 DataInputStream |
dataIn
|
protected DataOutputStream |
dataOut
|
protected int |
ioBufferSize
|
protected URI |
localLocation
|
protected int |
minmumWireFormatVersion
|
protected URI |
remoteLocation
|
protected Socket |
socket
|
protected int |
socketBufferSize
|
protected SocketFactory |
socketFactory
|
protected int |
soTimeout
|
protected boolean |
trace
|
protected boolean |
useLocalHost
|
protected WireFormat |
wireFormat
|
Constructor Summary | |
---|---|
TcpTransport(WireFormat wireFormat,
Socket socket)
Initialize from a server Socket |
|
TcpTransport(WireFormat wireFormat,
SocketFactory socketFactory,
URI remoteLocation,
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()
|
Boolean |
getKeepAlive()
|
int |
getMinmumWireFormatVersion()
|
String |
getRemoteAddress()
|
int |
getSocketBufferSize()
|
int |
getSoTimeout()
|
Boolean |
getTcpNoDelay()
|
protected void |
initialiseSocket(Socket sock)
Configures the socket for use |
protected void |
initializeStreams()
|
boolean |
isTrace()
|
boolean |
isUseLocalHost()
|
void |
oneway(Object command)
A one way asynchronous send |
protected Object |
readCommand()
|
protected String |
resolveHostName(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(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(Map socketOptions)
|
void |
setSoTimeout(int soTimeout)
Sets the socket timeout |
void |
setTcpNoDelay(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. |
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 URI remoteLocation
protected final URI localLocation
protected final WireFormat wireFormat
protected int connectionTimeout
protected int soTimeout
protected int socketBufferSize
protected int ioBufferSize
protected Socket socket
protected DataOutputStream dataOut
protected DataInputStream dataIn
protected boolean trace
protected boolean useLocalHost
protected int minmumWireFormatVersion
protected SocketFactory socketFactory
Constructor Detail |
---|
public TcpTransport(WireFormat wireFormat, SocketFactory socketFactory, URI remoteLocation, URI localLocation) throws UnknownHostException, IOException
wireFormat
- socketFactory
- remoteLocation
- localLocation
- -
e.g. local InetAddress and local port
IOException
UnknownHostException
public TcpTransport(WireFormat wireFormat, Socket socket) throws IOException
wireFormat
- socket
-
IOException
Method Detail |
---|
public void oneway(Object command) throws IOException
oneway
in interface Transport
IOException
public String toString()
toString
in class Object
public void run()
run
in interface Runnable
protected Object readCommand() throws IOException
IOException
public 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 Boolean getKeepAlive()
public void setKeepAlive(Boolean keepAlive)
public Boolean getTcpNoDelay()
public void setTcpNoDelay(Boolean tcpNoDelay)
public int getIoBufferSize()
public void setIoBufferSize(int ioBufferSize)
ioBufferSize
- the ioBufferSize to setprotected String resolveHostName(String host) throws UnknownHostException
UnknownHostException
protected void initialiseSocket(Socket sock) throws SocketException
sock
-
SocketException
protected void doStart() throws Exception
doStart
in class TransportThreadSupport
Exception
protected void connect() throws Exception
Exception
protected void doStop(ServiceStopper stopper) throws Exception
doStop
in class ServiceSupport
Exception
protected void initializeStreams() throws Exception
Exception
protected void closeStreams() throws IOException
IOException
public void setSocketOptions(Map socketOptions)
public String getRemoteAddress()
getRemoteAddress
in interface Transport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |