|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fusesource.stompjms.client.transport.BaseService
org.fusesource.stompjms.client.transport.TcpTransport
public class TcpTransport
An implementation of the Transport interface using raw tcp/ip
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.fusesource.stompjms.client.transport.BaseService |
|---|
BaseService.STARTING, BaseService.State, BaseService.STOPPING |
| Field Summary | |
|---|---|
protected java.nio.channels.SocketChannel |
channel
|
protected ProtocolCodec |
codec
|
protected org.fusesource.hawtdispatch.DispatchQueue |
dispatchQueue
|
static int |
IPTOS_LOWCOST
|
static int |
IPTOS_LOWDELAY
|
static int |
IPTOS_RELIABILITY
|
static int |
IPTOS_THROUGHPUT
|
protected TransportListener |
listener
|
protected java.net.URI |
localLocation
|
protected org.fusesource.stompjms.client.transport.TcpTransport.RateLimitingChannel |
rateLimitingChannel
|
protected java.net.URI |
remoteLocation
|
protected org.fusesource.stompjms.client.transport.TcpTransport.SocketState |
socketState
|
protected boolean |
useLocalHost
|
| Fields inherited from class org.fusesource.stompjms.client.transport.BaseService |
|---|
_serviceState, CREATED, STARTED, STOPPED |
| Constructor Summary | |
|---|---|
TcpTransport()
|
|
| Method Summary | ||
|---|---|---|
void |
_start(java.lang.Runnable onCompleted)
|
|
void |
_stop(java.lang.Runnable onCompleted)
|
|
void |
connected(java.nio.channels.SocketChannel channel)
|
|
void |
connecting(java.net.URI remoteLocation,
java.net.URI localLocation)
|
|
protected void |
drainInbound()
|
|
protected void |
drainOutbound()
|
|
protected boolean |
flush()
|
|
boolean |
full()
|
|
org.fusesource.hawtdispatch.DispatchQueue |
getDispatchQueue()
Returns the dispatch queue used by the transport |
|
java.net.SocketAddress |
getLocalAddress()
|
|
int |
getMaxReadRate()
|
|
int |
getMaxWriteRate()
|
|
ProtocolCodec |
getProtocolCodec()
|
|
int |
getReceiveBufferSize()
|
|
java.net.SocketAddress |
getRemoteAddress()
|
|
int |
getSendBufferSize()
|
|
java.nio.channels.SocketChannel |
getSocketChannel()
|
|
int |
getTrafficClass()
|
|
TransportListener |
getTransportListener()
Returns the current transport listener |
|
java.lang.String |
getTypeId()
|
|
protected void |
initializeCodec()
|
|
boolean |
isConnected()
|
|
boolean |
isDisposed()
|
|
boolean |
isFaultTolerant()
Indicates if the transport can handle faults |
|
boolean |
isUseLocalHost()
|
|
|
narrow(java.lang.Class<T> target)
|
|
boolean |
offer(java.lang.Object command)
A one way asynchronous send of a command. |
|
protected void |
onConnected()
|
|
void |
onTransportFailure(java.io.IOException error)
|
|
java.nio.channels.ReadableByteChannel |
readChannel()
|
|
void |
reconnect(java.net.URI uri)
reconnect to another location |
|
protected java.lang.String |
resolveHostName(java.lang.String host)
|
|
void |
resumeRead()
resume delivery of commands. |
|
protected void |
resumeWrite()
|
|
void |
setDispatchQueue(org.fusesource.hawtdispatch.DispatchQueue queue)
Sets the dispatch queue used by the transport |
|
void |
setMaxReadRate(int maxReadRate)
|
|
void |
setMaxWriteRate(int maxWriteRate)
|
|
void |
setProtocolCodec(ProtocolCodec protocolCodec)
Sets the protocol codec for the transport |
|
void |
setReceiveBufferSize(int receiveBufferSize)
|
|
void |
setSendBufferSize(int sendBufferSize)
|
|
void |
setTrafficClass(int trafficClass)
|
|
void |
setTransportListener(TransportListener listener)
Registers an inbound command listener |
|
void |
setUseLocalHost(boolean useLocalHost)
Sets whether 'localhost' or the actual local host name should be used to make local connections. |
|
void |
suspendRead()
suspend delivery of commands. |
|
protected void |
suspendWrite()
|
|
java.nio.channels.WritableByteChannel |
writeChannel()
|
|
| Methods inherited from class org.fusesource.stompjms.client.transport.BaseService |
|---|
getServiceState, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.fusesource.stompjms.client.transport.Transport |
|---|
start, stop |
| Field Detail |
|---|
protected java.net.URI remoteLocation
protected java.net.URI localLocation
protected TransportListener listener
protected ProtocolCodec codec
protected java.nio.channels.SocketChannel channel
protected org.fusesource.stompjms.client.transport.TcpTransport.SocketState socketState
protected org.fusesource.hawtdispatch.DispatchQueue dispatchQueue
protected boolean useLocalHost
public static final int IPTOS_LOWCOST
public static final int IPTOS_RELIABILITY
public static final int IPTOS_THROUGHPUT
public static final int IPTOS_LOWDELAY
protected org.fusesource.stompjms.client.transport.TcpTransport.RateLimitingChannel rateLimitingChannel
| Constructor Detail |
|---|
public TcpTransport()
| Method Detail |
|---|
public void connected(java.nio.channels.SocketChannel channel)
throws java.io.IOException,
java.lang.Exception
java.io.IOException
java.lang.Exception
protected void initializeCodec()
throws java.lang.Exception
java.lang.Exception
public void connecting(java.net.URI remoteLocation,
java.net.URI localLocation)
throws java.io.IOException,
java.lang.Exception
java.io.IOException
java.lang.Exceptionpublic org.fusesource.hawtdispatch.DispatchQueue getDispatchQueue()
Transport
getDispatchQueue in interface TransportgetDispatchQueue in class BaseServicepublic void setDispatchQueue(org.fusesource.hawtdispatch.DispatchQueue queue)
Transport
setDispatchQueue in interface Transportpublic void _start(java.lang.Runnable onCompleted)
_start in class BaseServicepublic void _stop(java.lang.Runnable onCompleted)
_stop in class BaseService
protected java.lang.String resolveHostName(java.lang.String host)
throws java.net.UnknownHostException
java.net.UnknownHostException
protected void onConnected()
throws java.io.IOException
java.io.IOExceptionpublic void onTransportFailure(java.io.IOException error)
public boolean full()
full in interface Transportpublic boolean offer(java.lang.Object command)
Transport
offer in interface Transportprotected void drainOutbound()
protected boolean flush()
throws java.io.IOException
java.io.IOExceptionprotected void drainInbound()
public java.net.SocketAddress getLocalAddress()
getLocalAddress in interface Transportpublic java.net.SocketAddress getRemoteAddress()
getRemoteAddress in interface Transportpublic <T> T narrow(java.lang.Class<T> target)
narrow in interface Transportpublic void suspendRead()
Transport
suspendRead in interface Transportpublic void resumeRead()
Transport
resumeRead in interface Transportprotected void suspendWrite()
protected void resumeWrite()
public java.lang.String getTypeId()
getTypeId in interface Transportpublic void reconnect(java.net.URI uri)
Transport
reconnect in interface Transportpublic TransportListener getTransportListener()
Transport
getTransportListener in interface Transportpublic void setTransportListener(TransportListener listener)
Transport
setTransportListener in interface Transportpublic ProtocolCodec getProtocolCodec()
getProtocolCodec in interface Transport
public void setProtocolCodec(ProtocolCodec protocolCodec)
throws java.lang.Exception
Transport
setProtocolCodec in interface Transportjava.lang.Exceptionpublic boolean isConnected()
isConnected in interface Transportpublic boolean isDisposed()
isDisposed in interface Transportpublic boolean isFaultTolerant()
Transport
isFaultTolerant in interface Transportpublic boolean isUseLocalHost()
public void setUseLocalHost(boolean useLocalHost)
public java.nio.channels.SocketChannel getSocketChannel()
public java.nio.channels.ReadableByteChannel readChannel()
public java.nio.channels.WritableByteChannel writeChannel()
public int getMaxReadRate()
public void setMaxReadRate(int maxReadRate)
public int getMaxWriteRate()
public void setMaxWriteRate(int maxWriteRate)
public int getTrafficClass()
public void setTrafficClass(int trafficClass)
public int getReceiveBufferSize()
public void setReceiveBufferSize(int receiveBufferSize)
public int getSendBufferSize()
public void setSendBufferSize(int sendBufferSize)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||