org.apache.activemq.apollo.transport.pipe
Class PipeTransport

java.lang.Object
  extended by org.apache.activemq.apollo.transport.pipe.PipeTransport
All Implemented Interfaces:
Transport, Service

public class PipeTransport
extends java.lang.Object
implements Transport

Author:
Hiram Chirino

Constructor Summary
PipeTransport(PipeTransportServer server)
           
 
Method Summary
 boolean full()
           
 org.fusesource.hawtdispatch.DispatchQueue getDispatchQueue()
          Returns the dispatch queue used by the transport
 ProtocolCodec getProtocolCodec()
           
 long getReadCounter()
           
 java.lang.String getRemoteAddress()
           
 TransportListener getTransportListener()
          Returns the current transport listener
 java.lang.String getTypeId()
           
 long getWriteCounter()
           
 boolean isConnected()
           
 boolean isDisposed()
           
 boolean isFaultTolerant()
          Indicates if the transport can handle faults
 boolean isMarshal()
           
 boolean isTrace()
           
<T> T
narrow(java.lang.Class<T> target)
           
 boolean offer(java.lang.Object command)
          A one way asynchronous send of a command.
 void reconnect(java.net.URI uri)
          reconnect to another location
 void resumeRead()
          resume delivery of commands.
 void setDispatchQueue(org.fusesource.hawtdispatch.DispatchQueue queue)
          Sets the dispatch queue used by the transport
 void setMarshal(boolean marshall)
           
 void setName(java.lang.String name)
           
 void setProtocolCodec(ProtocolCodec protocolCodec)
          Sets the protocol codec for the transport
 void setRemoteAddress(java.lang.String remoteAddress)
           
 void setTrace(boolean trace)
           
 void setTransportListener(TransportListener listener)
          Registers an inbound command listener
 void start()
           
 void start(java.lang.Runnable onCompleted)
           
 void stop()
           
 void stop(java.lang.Runnable onCompleted)
           
 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 org.fusesource.hawtdispatch.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(org.fusesource.hawtdispatch.DispatchQueue queue)
Description copied from interface: Transport
Sets the dispatch queue used by the transport

Specified by:
setDispatchQueue in interface Transport

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Service
Throws:
java.lang.Exception

start

public void start(java.lang.Runnable onCompleted)
           throws java.lang.Exception
Specified by:
start in interface Service
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Service
Throws:
java.lang.Exception

stop

public void stop(java.lang.Runnable onCompleted)
          throws java.lang.Exception
Specified by:
stop in interface Service
Throws:
java.lang.Exception

full

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

offer

public boolean offer(java.lang.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.

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.

getRemoteAddress

public java.lang.String getRemoteAddress()
Specified by:
getRemoteAddress in interface Transport
Returns:
the remote address for this connection

narrow

public <T> T narrow(java.lang.Class<T> target)
Specified by:
narrow in interface Transport
Returns:
the target

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

reconnect

public void reconnect(java.net.URI uri)
Description copied from interface: Transport
reconnect to another location

Specified by:
reconnect in interface Transport

getTypeId

public java.lang.String getTypeId()
Specified by:
getTypeId in interface Transport
Returns:
the identifier for the transport type. Example "tcp" for the tcp transport.

setRemoteAddress

public void setRemoteAddress(java.lang.String remoteAddress)

setName

public void setName(java.lang.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 listener)
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

isDisposed

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

isFaultTolerant

public boolean isFaultTolerant()
Description copied from interface: Transport
Indicates if the transport can handle faults

Specified by:
isFaultTolerant in interface Transport
Returns:
true if fault tolerant


Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.