org.apache.geronimo.gshell.whisper.transport.base
Class BaseTransport<T extends org.apache.mina.common.IoConnector>

java.lang.Object
  extended by org.apache.geronimo.gshell.whisper.transport.base.BaseService
      extended by org.apache.geronimo.gshell.whisper.transport.base.BaseTransport<T>
All Implemented Interfaces:
Closeable, Transport
Direct Known Subclasses:
TcpTransport, VmTransport

public abstract class BaseTransport<T extends org.apache.mina.common.IoConnector>
extends BaseService
implements Transport

Support for Transport implementations.

Version:
$Rev: 580731 $ $Date: 2007-09-30 07:52:42 -0700 (Sun, 30 Sep 2007) $

Nested Class Summary
protected static class BaseTransport.BaseTransportConfiguration
           
 
Nested classes/interfaces inherited from interface org.apache.geronimo.gshell.whisper.transport.Transport
Transport.Configuration, Transport.Listener
 
Field Summary
protected  T connector
           
protected  SocketAddress localAddress
           
protected  URI localLocation
           
protected  SocketAddress remoteAddress
           
protected  URI remoteLocation
           
protected  org.apache.mina.common.IoSession session
           
 
Fields inherited from class org.apache.geronimo.gshell.whisper.transport.base.BaseService
addressFactory, log
 
Constructor Summary
protected BaseTransport(AddressFactory addressFactory)
           
 
Method Summary
 void addListener(Transport.Listener listener)
           
 void close()
           
protected abstract  Transport.Configuration createConfiguration()
           
protected abstract  T createConnector()
           
protected  org.apache.mina.common.ThreadModel createThreadModel()
           
protected  BaseConfiguration getBaseConfiguration()
           
 Transport.Configuration getConfiguration()
           
 T getConnector()
           
 OutputStream getErrorStream()
           
 InputStream getInputStream()
           
 URI getLocal()
           
 OutputStream getOutputStream()
           
 URI getRemote()
           
 org.apache.mina.common.IoSession getSession()
           
 void removeListener(Transport.Listener listener)
           
 Message request(Message msg)
           
 Message request(Message msg, Duration timeout)
           
 org.apache.mina.common.WriteFuture send(Object msg)
           
 void setConfiguration(Transport.Configuration config)
           
 
Methods inherited from class org.apache.geronimo.gshell.whisper.transport.base.BaseService
configure, configure, configure, configure, createHandler, ensureOpened, getHandler, getThreadModel, isClosed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

remoteLocation

protected URI remoteLocation

remoteAddress

protected SocketAddress remoteAddress

localLocation

protected URI localLocation

localAddress

protected SocketAddress localAddress

connector

protected T extends org.apache.mina.common.IoConnector connector

session

protected org.apache.mina.common.IoSession session
Constructor Detail

BaseTransport

protected BaseTransport(AddressFactory addressFactory)
Method Detail

createConfiguration

protected abstract Transport.Configuration createConfiguration()

getConfiguration

public Transport.Configuration getConfiguration()
Specified by:
getConfiguration in interface Transport

setConfiguration

public void setConfiguration(Transport.Configuration config)
Specified by:
setConfiguration in interface Transport

getBaseConfiguration

protected BaseConfiguration getBaseConfiguration()
Specified by:
getBaseConfiguration in class BaseService

createThreadModel

protected org.apache.mina.common.ThreadModel createThreadModel()
                                                        throws Exception
Overrides:
createThreadModel in class BaseService
Throws:
Exception

createConnector

protected abstract T createConnector()
                                                                         throws Exception
Throws:
Exception

close

public void close()
Specified by:
close in interface Closeable
Specified by:
close in interface Transport
Overrides:
close in class BaseService

getRemote

public URI getRemote()
Specified by:
getRemote in interface Transport

getLocal

public URI getLocal()
Specified by:
getLocal in interface Transport

getConnector

public T getConnector()
Specified by:
getConnector in interface Transport

getSession

public org.apache.mina.common.IoSession getSession()
Specified by:
getSession in interface Transport

getInputStream

public InputStream getInputStream()
Specified by:
getInputStream in interface Transport

getOutputStream

public OutputStream getOutputStream()
Specified by:
getOutputStream in interface Transport

getErrorStream

public OutputStream getErrorStream()
Specified by:
getErrorStream in interface Transport

send

public org.apache.mina.common.WriteFuture send(Object msg)
                                        throws Exception
Specified by:
send in interface Transport
Throws:
Exception

request

public Message request(Message msg)
                throws Exception
Specified by:
request in interface Transport
Throws:
Exception

request

public Message request(Message msg,
                       Duration timeout)
                throws Exception
Specified by:
request in interface Transport
Throws:
Exception

addListener

public void addListener(Transport.Listener listener)
Specified by:
addListener in interface Transport

removeListener

public void removeListener(Transport.Listener listener)
Specified by:
removeListener in interface Transport


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.