|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fusesource.hawtdispatch.transport.TcpTransportServer
public class TcpTransportServer
A TCP based implementation of TransportServer
Field Summary | |
---|---|
protected DispatchSource |
acceptSource
|
protected int |
backlog
|
protected InetSocketAddress |
bindAddress
|
protected String |
bindScheme
|
protected Executor |
blockingExecutor
|
protected ServerSocketChannel |
channel
|
protected DispatchQueue |
dispatchQueue
|
protected TransportServerListener |
listener
|
protected int |
receiveBufferSize
|
protected int |
sendBufferSize
|
Constructor Summary | |
---|---|
TcpTransportServer(URI location)
|
Method Summary | |
---|---|
protected TcpTransport |
createTransport()
|
int |
getBacklog()
|
Executor |
getBlockingExecutor()
|
String |
getBoundAddress()
|
DispatchQueue |
getDispatchQueue()
Returns the dispatch queue used by the transport |
int |
getReceiveBufferSize()
|
int |
getSendBufferSize()
|
InetSocketAddress |
getSocketAddress()
|
protected void |
handleSocket(SocketChannel socket)
|
void |
resume()
resume accepting new transports |
void |
setBacklog(int backlog)
|
void |
setBlockingExecutor(Executor blockingExecutor)
|
void |
setDispatchQueue(DispatchQueue dispatchQueue)
Sets the dispatch queue used by the transport |
void |
setReceiveBufferSize(int receiveBufferSize)
|
void |
setSendBufferSize(int sendBufferSize)
|
void |
setTransportServerListener(TransportServerListener listener)
Registers an TransportAcceptListener which is notified of accepted
channels. |
void |
start(Runnable onCompleted)
Deprecated. |
void |
start(Task onCompleted)
Starts the service. |
void |
stop(Runnable onCompleted)
Deprecated. |
void |
stop(Task onCompleted)
Stops the service. |
void |
suspend()
suspend accepting new transports |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final String bindScheme
protected final InetSocketAddress bindAddress
protected int backlog
protected ServerSocketChannel channel
protected TransportServerListener listener
protected DispatchQueue dispatchQueue
protected DispatchSource acceptSource
protected int receiveBufferSize
protected int sendBufferSize
protected Executor blockingExecutor
Constructor Detail |
---|
public TcpTransportServer(URI location) throws UnknownHostException
UnknownHostException
Method Detail |
---|
public void setTransportServerListener(TransportServerListener listener)
TransportServer
TransportAcceptListener
which is notified of accepted
channels.
setTransportServerListener
in interface TransportServer
public InetSocketAddress getSocketAddress()
getSocketAddress
in interface TransportServer
public DispatchQueue getDispatchQueue()
TransportServer
getDispatchQueue
in interface TransportServer
public void setDispatchQueue(DispatchQueue dispatchQueue)
TransportServer
setDispatchQueue
in interface TransportServer
public void suspend()
TransportServer
suspend
in interface TransportServer
public void resume()
TransportServer
resume
in interface TransportServer
@Deprecated public void start(Runnable onCompleted) throws Exception
start
in interface TransportServer
Exception
@Deprecated public void stop(Runnable onCompleted) throws Exception
stop
in interface TransportServer
Exception
public void start(Task onCompleted) throws Exception
TransportServer
start
in interface TransportServer
onCompleted
- my be set to null if not interested in a callback.
Exception
public String getBoundAddress()
getBoundAddress
in interface TransportServer
public void stop(Task onCompleted) throws Exception
TransportServer
stop
in interface TransportServer
onCompleted
- my be set to null if not interested in a callback.
Exception
public int getBacklog()
public void setBacklog(int backlog)
protected final void handleSocket(SocketChannel socket) throws Exception
Exception
protected TcpTransport createTransport()
public String toString()
toString
in class Object
public int getReceiveBufferSize()
public void setReceiveBufferSize(int receiveBufferSize)
public int getSendBufferSize()
public void setSendBufferSize(int sendBufferSize)
public Executor getBlockingExecutor()
getBlockingExecutor
in interface TransportServer
public void setBlockingExecutor(Executor blockingExecutor)
setBlockingExecutor
in interface TransportServer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |