org.fusesource.hawtdispatch.transport
Interface TransportServer

All Known Implementing Classes:
PipeTransportServer, SslTransportServer, TcpTransportServer, UdpTransportServer

public interface TransportServer

A TransportServer asynchronously accepts Transport objects and then delivers those objects to a TransportAcceptListener.

Version:
$Revision: 1.4 $

Method Summary
 Executor getBlockingExecutor()
           
 String getBoundAddress()
           
 DispatchQueue getDispatchQueue()
          Returns the dispatch queue used by the transport
 SocketAddress getSocketAddress()
           
 void resume()
          resume accepting new transports
 void setBlockingExecutor(Executor blockingExecutor)
           
 void setDispatchQueue(DispatchQueue queue)
          Sets the dispatch queue used by the transport
 void setTransportServerListener(TransportServerListener acceptListener)
          Registers an TransportAcceptListener which is notified of accepted channels.
 void start(Runnable onComplete)
           
 void start(Task onComplete)
          Starts the service.
 void stop(Runnable onComplete)
           
 void stop(Task onComplete)
          Stops the service.
 void suspend()
          suspend accepting new transports
 

Method Detail

start

void start(Task onComplete)
           throws Exception
Starts the service. Executes the onComplete runnable once the service has fully started up.

Parameters:
onComplete - my be set to null if not interested in a callback.
Throws:
Exception

start

void start(Runnable onComplete)
           throws Exception
Throws:
Exception

stop

void stop(Task onComplete)
          throws Exception
Stops the service. Executes the onComplete runnable once the service has fully stopped.

Parameters:
onComplete - my be set to null if not interested in a callback.
Throws:
Exception

stop

void stop(Runnable onComplete)
          throws Exception
Throws:
Exception

setTransportServerListener

void setTransportServerListener(TransportServerListener acceptListener)
Registers an TransportAcceptListener which is notified of accepted channels.

Parameters:
acceptListener -

getBoundAddress

String getBoundAddress()

getSocketAddress

SocketAddress getSocketAddress()
Returns:
The socket address that this transport is accepting connections on or null if this does not or is not currently accepting connections on a socket.

getDispatchQueue

DispatchQueue getDispatchQueue()
Returns the dispatch queue used by the transport

Returns:

setDispatchQueue

void setDispatchQueue(DispatchQueue queue)
Sets the dispatch queue used by the transport

Parameters:
queue -

suspend

void suspend()
suspend accepting new transports


resume

void resume()
resume accepting new transports


getBlockingExecutor

Executor getBlockingExecutor()

setBlockingExecutor

void setBlockingExecutor(Executor blockingExecutor)


Copyright © 2010-2014 FuseSource, Corp.. All Rights Reserved.