|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fusesource.fabric.dosgi.tcp.TcpTransport
public class TcpTransport
| Nested Class Summary | |
|---|---|
static class |
TcpTransport.STARTING
|
static class |
TcpTransport.State
|
static class |
TcpTransport.STOPPING
|
| Field Summary | |
|---|---|
protected TcpTransport.State |
_serviceState
|
protected java.nio.channels.SocketChannel |
channel
|
protected ProtocolCodec |
codec
|
static TcpTransport.State |
CREATED
|
protected org.fusesource.hawtdispatch.DispatchQueue |
dispatchQueue
|
protected TransportListener |
listener
|
protected java.net.URI |
localLocation
|
protected org.fusesource.fabric.dosgi.tcp.TcpTransport.RateLimitingChannel |
rateLimitingChannel
|
protected java.lang.String |
remoteAddress
|
protected java.net.URI |
remoteLocation
|
protected java.util.Map<java.lang.String,java.lang.Object> |
socketOptions
|
protected org.fusesource.fabric.dosgi.tcp.TcpTransport.SocketState |
socketState
|
static TcpTransport.State |
STARTED
|
static TcpTransport.State |
STOPPED
|
protected boolean |
useLocalHost
|
| 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()
|
int |
getMax_read_rate()
|
int |
getMax_write_rate()
|
ProtocolCodec |
getProtocolCodec()
|
java.lang.String |
getRemoteAddress()
|
protected TcpTransport.State |
getServiceState()
|
java.nio.channels.SocketChannel |
getSocketChannel()
|
TransportListener |
getTransportListener()
Returns the current transport listener |
protected void |
initializeCodec()
|
boolean |
isConnected()
|
boolean |
isDisposed()
|
boolean |
isUseLocalHost()
|
boolean |
offer(java.lang.Object command)
A one way asynchronous send of a command. |
protected void |
onConnected()
|
void |
onTransportFailure(java.io.IOException error)
|
org.fusesource.hawtdispatch.DispatchQueue |
queue()
|
java.nio.channels.ReadableByteChannel |
readChannel()
|
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 |
setMax_read_rate(int max_read_rate)
|
void |
setMax_write_rate(int max_write_rate)
|
void |
setProtocolCodec(ProtocolCodec protocolCodec)
Sets the protocol codec for the transport |
void |
setSocketOptions(java.util.Map<java.lang.String,java.lang.Object> socketOptions)
|
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 |
start()
Starts the service. |
void |
start(java.lang.Runnable onCompleted)
Starts the service. |
void |
stop()
Stops the service. |
void |
stop(java.lang.Runnable onCompleted)
Stops the service. |
void |
suspendRead()
suspend delivery of commands. |
protected void |
suspendWrite()
|
java.nio.channels.WritableByteChannel |
writeChannel()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TcpTransport.State _serviceState
protected java.util.Map<java.lang.String,java.lang.Object> socketOptions
public static final TcpTransport.State CREATED
public static final TcpTransport.State STARTED
public static final TcpTransport.State STOPPED
protected java.net.URI remoteLocation
protected java.net.URI localLocation
protected TransportListener listener
protected java.lang.String remoteAddress
protected ProtocolCodec codec
protected java.nio.channels.SocketChannel channel
protected org.fusesource.fabric.dosgi.tcp.TcpTransport.SocketState socketState
protected org.fusesource.hawtdispatch.DispatchQueue dispatchQueue
protected boolean useLocalHost
protected org.fusesource.fabric.dosgi.tcp.TcpTransport.RateLimitingChannel rateLimitingChannel
| Constructor Detail |
|---|
public TcpTransport()
| Method Detail |
|---|
public final void start()
Service
start in interface Servicepublic final void stop()
Service
stop in interface Servicepublic final void start(java.lang.Runnable onCompleted)
Service
start in interface ServiceonCompleted - my be set to null if not interested in a callback.public final void stop(java.lang.Runnable onCompleted)
Service
stop in interface ServiceonCompleted - my be set to null if not interested in a callback.protected TcpTransport.State getServiceState()
public void connected(java.nio.channels.SocketChannel channel)
throws java.io.IOException,
java.lang.Exception
java.io.IOException
java.lang.Exceptionprotected void initializeCodec()
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 queue()
queue in interface Dispatchedpublic void setDispatchQueue(org.fusesource.hawtdispatch.DispatchQueue queue)
Transport
setDispatchQueue in interface Transportpublic void _start(java.lang.Runnable onCompleted)
public void _stop(java.lang.Runnable onCompleted)
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.lang.String getRemoteAddress()
getRemoteAddress in interface Transportpublic void suspendRead()
Transport
suspendRead in interface Transportpublic void resumeRead()
Transport
resumeRead in interface Transportprotected void suspendWrite()
protected void resumeWrite()
public TransportListener getTransportListener()
Transport
getTransportListener in interface Transportpublic void setTransportListener(TransportListener listener)
Transport
setTransportListener in interface Transportpublic ProtocolCodec getProtocolCodec()
getProtocolCodec in interface Transportpublic void setProtocolCodec(ProtocolCodec protocolCodec)
Transport
setProtocolCodec in interface Transportpublic boolean isConnected()
isConnected in interface Transportpublic boolean isDisposed()
isDisposed in interface Transportpublic void setSocketOptions(java.util.Map<java.lang.String,java.lang.Object> socketOptions)
public 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 getMax_read_rate()
public void setMax_read_rate(int max_read_rate)
public int getMax_write_rate()
public void setMax_write_rate(int max_write_rate)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||