|
|||||||||||
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 DataInputStream |
dataIn
|
protected DataOutputStream |
dataOut
|
protected Socket |
socket
|
Fields inherited from class org.activemq.transport.TransportChannelSupport |
cachingEnabled, currentWireFormat, noDelay, pendingStop, transportConnected, usedInternally |
Constructor Summary | |
|
TcpTransportChannel(TcpTransportServerChannel serverChannel,
WireFormat wireFormat,
Socket socket,
Executor executor)
Initialize from a ServerSocket |
protected |
TcpTransportChannel(WireFormat wireFormat)
Construct basic helpers |
|
TcpTransportChannel(WireFormat wireFormat,
Socket socket,
Executor executor)
|
|
TcpTransportChannel(WireFormat wireFormat,
URI remoteLocation)
Connect to a remote Node - e.g. |
|
TcpTransportChannel(WireFormat wireFormat,
URI remoteLocation,
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 Socket |
createSocket(URI remoteLocation)
Factory method to create a new socket |
protected Socket |
createSocket(URI remoteLocation,
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(Exception ex)
|
void |
forceDisconnect()
Forces an immediate transport-level disconnect which will be asynchronously reported as an exception to the exceptionListener. |
int |
getCurrentWireFormatVersion()
|
Socket |
getSocket()
|
int |
getSocketBufferSize()
|
int |
getSoTimeout()
|
protected void |
initialiseSocket(Socket sock)
Configures the socket for use |
protected void |
initializeStreams()
|
boolean |
isClosed()
|
boolean |
isMulticast()
|
boolean |
isUseAsyncSend()
|
protected void |
readWireFormat()
|
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 |
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 Socket socket
protected DataOutputStream dataOut
protected DataInputStream dataIn
Constructor Detail |
protected TcpTransportChannel(WireFormat wireFormat)
wireFormat
- public TcpTransportChannel(WireFormat wireFormat, URI remoteLocation) throws JMSException
wireFormat
- remoteLocation
-
JMSException
public TcpTransportChannel(WireFormat wireFormat, URI remoteLocation, URI localLocation) throws JMSException
wireFormat
- remoteLocation
- localLocation
- - e.g. local InetAddress and local port
JMSException
public TcpTransportChannel(TcpTransportServerChannel serverChannel, WireFormat wireFormat, Socket socket, Executor executor) throws JMSException
serverChannel
- wireFormat
- socket
- executor
-
JMSException
public TcpTransportChannel(WireFormat wireFormat, Socket socket, Executor executor) throws JMSException
Method Detail |
public void start() throws JMSException
start
in interface TransportChannel
JMSException
- if an error occursprotected void readWireFormat() throws JMSException, IOException
JMSException
IOException
public void stop()
stop
in interface TransportChannel
stop
in class TransportChannelSupport
public void forceDisconnect()
TransportChannel
forceDisconnect
in interface TransportChannel
public void asyncSend(Packet packet) throws JMSException
asyncSend
in interface TransportChannel
packet
-
JMSException
public boolean isMulticast()
isMulticast
in interface TransportChannel
isMulticast
in class TransportChannelSupport
public void run()
run
in interface Runnable
public boolean isClosed()
public String toString()
public Socket getSocket()
public boolean canProcessWireFormatVersion(int version)
canProcessWireFormatVersion
in interface TransportChannel
canProcessWireFormatVersion
in class TransportChannelSupport
version
- the version number to test
public int getCurrentWireFormatVersion()
getCurrentWireFormatVersion
in interface TransportChannel
getCurrentWireFormatVersion
in class TransportChannelSupport
public boolean isUseAsyncSend()
public void setUseAsyncSend(boolean useAsyncSend)
useAsyncSend
- public int getSoTimeout()
public void setSoTimeout(int soTimeout) throws JMSException
soTimeout
-
JMSException
public void setNoDelay(boolean noDelay)
setNoDelay
in interface TransportChannel
setNoDelay
in class TransportChannelSupport
noDelay
- The noDelay to set.public int getSocketBufferSize()
public void setSocketBufferSize(int socketBufferSize)
socketBufferSize
- The socketBufferSize to set.protected Packet doAsyncSend(Packet packet) throws JMSException
doAsyncSend
in class TransportChannelSupport
packet
-
JMSException
protected void doClose(Exception ex)
protected void initialiseSocket(Socket sock) throws SocketException
sock
-
SocketException
protected void initializeStreams() throws IOException
IOException
protected void closeStreams() throws IOException
IOException
protected Socket createSocket(URI remoteLocation) throws UnknownHostException, IOException
remoteLocation
- the URI to connect to
UnknownHostException
IOException
protected Socket createSocket(URI remoteLocation, URI localLocation) throws IOException, UnknownHostException
remoteLocation
- localLocation
-
IOException
UnknownHostException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |