|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.activemq.transport.TransportChannelSupport
org.activemq.transport.tcp.TcpTransportChannel
A tcp implementation of a TransportChannel
| Field Summary | |
protected java.io.DataInputStream |
dataIn
|
protected java.io.DataOutputStream |
dataOut
|
protected java.net.Socket |
socket
|
| Fields inherited from class org.activemq.transport.TransportChannelSupport |
cachingEnabled, currentWireFormat, noDelay, pendingStop, transportConnected, usedInternally |
| Constructor Summary | |
|
TcpTransportChannel(TcpTransportServerChannel serverChannel,
WireFormat wireFormat,
java.net.Socket socket,
EDU.oswego.cs.dl.util.concurrent.Executor executor)
Initialize from a ServerSocket |
protected |
TcpTransportChannel(WireFormat wireFormat)
Construct basic helpers |
|
TcpTransportChannel(WireFormat wireFormat,
java.net.Socket socket,
EDU.oswego.cs.dl.util.concurrent.Executor executor)
|
|
TcpTransportChannel(WireFormat wireFormat,
java.net.URI remoteLocation)
Connect to a remote Node - e.g. |
|
TcpTransportChannel(WireFormat wireFormat,
java.net.URI remoteLocation,
java.net.URI localLocation)
Connect to a remote Node - e.g. |
| Method Summary | |
void |
asyncSend(Packet packet)
Asynchronously send a Packet |
boolean |
canProcessWireFormatVersion(int version)
Can this wireformat process packets of this version |
protected void |
closeStreams()
|
protected java.net.Socket |
createSocket(java.net.URI remoteLocation)
Factory method to create a new socket |
protected java.net.Socket |
createSocket(java.net.URI remoteLocation,
java.net.URI localLocation)
Factory method to create a new socket |
protected Packet |
doAsyncSend(Packet packet)
Actually performs the async send of a packet |
protected void |
doClose(java.lang.Exception ex)
|
void |
forceDisconnect()
Forces an immediate transport-level disconnect which will be asynchronously reported as an exception to the exceptionListener. |
int |
getCurrentWireFormatVersion()
|
java.net.Socket |
getSocket()
|
int |
getSocketBufferSize()
|
int |
getSoTimeout()
|
protected void |
initialiseSocket(java.net.Socket sock)
Configures the socket for use |
protected void |
initializeStreams()
|
boolean |
isClosed()
|
boolean |
isMulticast()
|
boolean |
isUseAsyncSend()
|
void |
run()
reads packets from a Socket |
void |
setNoDelay(boolean noDelay)
|
void |
setSocketBufferSize(int socketBufferSize)
|
void |
setSoTimeout(int soTimeout)
set the socket so timeout |
void |
setUseAsyncSend(boolean useAsyncSend)
set the useAsync flag |
void |
start()
start listeneing for events |
void |
stop()
close the channel |
java.lang.String |
toString()
pretty print for object |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.net.Socket socket
protected java.io.DataOutputStream dataOut
protected java.io.DataInputStream dataIn
| Constructor Detail |
protected TcpTransportChannel(WireFormat wireFormat)
wireFormat -
public TcpTransportChannel(WireFormat wireFormat,
java.net.URI remoteLocation)
throws javax.jms.JMSException
wireFormat - remoteLocation -
javax.jms.JMSException
public TcpTransportChannel(WireFormat wireFormat,
java.net.URI remoteLocation,
java.net.URI localLocation)
throws javax.jms.JMSException
wireFormat - remoteLocation - localLocation - - e.g. local InetAddress and local port
javax.jms.JMSException
public TcpTransportChannel(TcpTransportServerChannel serverChannel,
WireFormat wireFormat,
java.net.Socket socket,
EDU.oswego.cs.dl.util.concurrent.Executor executor)
throws javax.jms.JMSException
serverChannel - wireFormat - socket - executor -
javax.jms.JMSException
public TcpTransportChannel(WireFormat wireFormat,
java.net.Socket socket,
EDU.oswego.cs.dl.util.concurrent.Executor executor)
throws javax.jms.JMSException
| Method Detail |
public void start()
throws javax.jms.JMSException
start in interface TransportChanneljavax.jms.JMSException - if an error occurspublic void stop()
stop in interface TransportChannelstop in class TransportChannelSupportpublic void forceDisconnect()
TransportChannel
forceDisconnect in interface TransportChannel
public void asyncSend(Packet packet)
throws javax.jms.JMSException
asyncSend in interface TransportChannelpacket -
javax.jms.JMSExceptionpublic boolean isMulticast()
isMulticast in interface TransportChannelisMulticast in class TransportChannelSupportpublic void run()
run in interface java.lang.Runnablepublic boolean isClosed()
public java.lang.String toString()
public java.net.Socket getSocket()
public boolean canProcessWireFormatVersion(int version)
canProcessWireFormatVersion in interface TransportChannelcanProcessWireFormatVersion in class TransportChannelSupportversion - the version number to test
public int getCurrentWireFormatVersion()
getCurrentWireFormatVersion in interface TransportChannelgetCurrentWireFormatVersion in class TransportChannelSupportpublic boolean isUseAsyncSend()
public void setUseAsyncSend(boolean useAsyncSend)
useAsyncSend - public int getSoTimeout()
public void setSoTimeout(int soTimeout)
throws javax.jms.JMSException
soTimeout -
javax.jms.JMSExceptionpublic void setNoDelay(boolean noDelay)
setNoDelay in interface TransportChannelsetNoDelay in class TransportChannelSupportnoDelay - The noDelay to set.public int getSocketBufferSize()
public void setSocketBufferSize(int socketBufferSize)
socketBufferSize - The socketBufferSize to set.
protected Packet doAsyncSend(Packet packet)
throws javax.jms.JMSException
doAsyncSend in class TransportChannelSupportpacket -
javax.jms.JMSExceptionprotected void doClose(java.lang.Exception ex)
protected void initialiseSocket(java.net.Socket sock)
throws java.net.SocketException
sock -
java.net.SocketException
protected void initializeStreams()
throws java.io.IOException
java.io.IOException
protected void closeStreams()
throws java.io.IOException
java.io.IOException
protected java.net.Socket createSocket(java.net.URI remoteLocation)
throws java.net.UnknownHostException,
java.io.IOException
remoteLocation - the URI to connect to
java.net.UnknownHostException
java.io.IOException
protected java.net.Socket createSocket(java.net.URI remoteLocation,
java.net.URI localLocation)
throws java.io.IOException,
java.net.UnknownHostException
remoteLocation - localLocation -
java.io.IOException
java.net.UnknownHostException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||