org.fusesource.hawtdispatch.transport
Class PipeTransport

java.lang.Object
  extended by org.fusesource.hawtdispatch.transport.PipeTransport
All Implemented Interfaces:
Transport

public class PipeTransport
extends Object
implements Transport

Author:
Hiram Chirino

Constructor Summary
PipeTransport(PipeTransportServer server)
           
 
Method Summary
 void drainInbound()
           
 void flush()
          Forces a flush of any output buffers.
 boolean full()
           
 Executor getBlockingExecutor()
           
 DispatchQueue getDispatchQueue()
          Returns the dispatch queue used by the transport
 SocketAddress getLocalAddress()
           
 ProtocolCodec getProtocolCodec()
           
 ReadableByteChannel getReadChannel()
           
 long getReadCounter()
           
 SocketAddress getRemoteAddress()
           
 TransportListener getTransportListener()
          Returns the current transport listener
 WritableByteChannel getWriteChannel()
           
 long getWriteCounter()
           
 boolean isClosed()
           
 boolean isConnected()
           
 boolean isMarshal()
           
 boolean isTrace()
           
 boolean offer(Object command)
          A one way asynchronous send of a command.
 void resumeRead()
          resume delivery of commands.
 void setBlockingExecutor(Executor blockingExecutor)
           
 void setDispatchQueue(DispatchQueue queue)
          Sets the dispatch queue used by the transport
 void setMarshal(boolean marshall)
           
 void setName(String name)
           
 void setProtocolCodec(ProtocolCodec protocolCodec)
          Sets the protocol codec for the transport
 void setRemoteAddress(String remoteAddress)
           
 void setTrace(boolean trace)
           
 void setTransportListener(TransportListener transportListener)
          Registers an inbound command listener
 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 suspendRead()
          suspend delivery of commands.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipeTransport

public PipeTransport(PipeTransportServer server)
Method Detail

getDispatchQueue

public DispatchQueue getDispatchQueue()
Description copied from interface: Transport
Returns the dispatch queue used by the transport

Specified by:
getDispatchQueue in interface Transport
Returns:

setDispatchQueue

public void setDispatchQueue(DispatchQueue queue)
Description copied from interface: Transport
Sets the dispatch queue used by the transport

Specified by:
setDispatchQueue in interface Transport

start

@Deprecated
public void start(Runnable onCompleted)
Deprecated. 

Description copied from interface: Transport
Starts the service. Executes the onComplete runnable once the service has fully started up.

Specified by:
start in interface Transport
Parameters:
onCompleted - my be set to null if not interested in a callback.

start

public void start(Task onCompleted)
Description copied from interface: Transport
Starts the service. Executes the onComplete runnable once the service has fully started up.

Specified by:
start in interface Transport
Parameters:
onCompleted - my be set to null if not interested in a callback.

flush

public void flush()
Description copied from interface: Transport
Forces a flush of any output buffers. Once the flush completes the listener's 'onRefill()' method will execute.

Specified by:
flush in interface Transport

stop

@Deprecated
public void stop(Runnable onCompleted)
Deprecated. 

Description copied from interface: Transport
Stops the service. Executes the onComplete runnable once the service has fully stopped.

Specified by:
stop in interface Transport
Parameters:
onCompleted - my be set to null if not interested in a callback.

stop

public void stop(Task onCompleted)
Description copied from interface: Transport
Stops the service. Executes the onComplete runnable once the service has fully stopped.

Specified by:
stop in interface Transport
Parameters:
onCompleted - my be set to null if not interested in a callback.

full

public boolean full()
Specified by:
full in interface Transport

offer

public boolean offer(Object command)
Description copied from interface: Transport
A one way asynchronous send of a command. Only sent if the the transport is not full.

Specified by:
offer in interface Transport
Returns:
true if the command was accepted.

drainInbound

public void drainInbound()
Specified by:
drainInbound in interface Transport

getWriteCounter

public long getWriteCounter()
Returns:
The number of objects sent by the transport.

getReadCounter

public long getReadCounter()
Returns:
The number of objects received by the transport.

getLocalAddress

public SocketAddress getLocalAddress()
Specified by:
getLocalAddress in interface Transport
Returns:
the remote address for this connection

getRemoteAddress

public SocketAddress getRemoteAddress()
Specified by:
getRemoteAddress in interface Transport
Returns:
the remote address for this connection

suspendRead

public void suspendRead()
Description copied from interface: Transport
suspend delivery of commands.

Specified by:
suspendRead in interface Transport

resumeRead

public void resumeRead()
Description copied from interface: Transport
resume delivery of commands.

Specified by:
resumeRead in interface Transport

setRemoteAddress

public void setRemoteAddress(String remoteAddress)

setName

public void setName(String name)

getTransportListener

public TransportListener getTransportListener()
Description copied from interface: Transport
Returns the current transport listener

Specified by:
getTransportListener in interface Transport
Returns:

setTransportListener

public void setTransportListener(TransportListener transportListener)
Description copied from interface: Transport
Registers an inbound command listener

Specified by:
setTransportListener in interface Transport

getProtocolCodec

public ProtocolCodec getProtocolCodec()
Specified by:
getProtocolCodec in interface Transport
Returns:
The protocol codec for the transport.

setProtocolCodec

public void setProtocolCodec(ProtocolCodec protocolCodec)
Description copied from interface: Transport
Sets the protocol codec for the transport

Specified by:
setProtocolCodec in interface Transport

isTrace

public boolean isTrace()

setTrace

public void setTrace(boolean trace)

isMarshal

public boolean isMarshal()

setMarshal

public void setMarshal(boolean marshall)

isConnected

public boolean isConnected()
Specified by:
isConnected in interface Transport
Returns:
true if the transport is connected

isClosed

public boolean isClosed()
Specified by:
isClosed in interface Transport
Returns:
true if the transport is closed/stopped.

getBlockingExecutor

public Executor getBlockingExecutor()
Specified by:
getBlockingExecutor in interface Transport

setBlockingExecutor

public void setBlockingExecutor(Executor blockingExecutor)
Specified by:
setBlockingExecutor in interface Transport

getReadChannel

public ReadableByteChannel getReadChannel()
Specified by:
getReadChannel in interface Transport

getWriteChannel

public WritableByteChannel getWriteChannel()
Specified by:
getWriteChannel in interface Transport


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