org.objectweb.dream.channel
Class AbstractTCPChannelOutImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.channel.AbstractTCPChannelOutImpl
All Implemented Interfaces:
AttributeController, BindingController, ChannelOutAttributeController, LifeCycleController, Loggable, Push
Direct Known Subclasses:
BasicTCPChannelOutImpl, MonoDestinationTCPChannelOutImpl, MultiConnTCPChannelOutImpl

public abstract class AbstractTCPChannelOutImpl
extends AbstractComponent
implements Push, ChannelOutAttributeController

Abstract implementation of a ChannelOut component.


Field Summary
protected  int cnxRetry
           
protected  MessageCodec messageCodecItf
           
protected  MessageManager messageManagerItf
           
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.Push
IN_PUSH_ITF_NAME, OUT_PUSH_ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
AbstractTCPChannelOutImpl()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
           
protected  void closeSocket(Socket out)
          This method close a socket.
protected  Socket connectSocket(InetAddress addr, int port)
          This method connects and returns a socket.
 int getConnectionRetry()
          Returns the number of attempt to connect to ChannelIn before abording.
 String[] listFc()
           
 void setConnectionRetry(int retry)
          Sets the number of attempt to connect to ChannelIn before abording.
protected  void setSocketOption(Socket sock)
          Configures this socket using the socket options established for this factory.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
getFcState, initComponent, lookupFc, setLogger, startFc, stopFc, unbindFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.dream.Push
push
 

Field Detail

cnxRetry

protected int cnxRetry

messageManagerItf

protected MessageManager messageManagerItf

messageCodecItf

protected MessageCodec messageCodecItf
Constructor Detail

AbstractTCPChannelOutImpl

public AbstractTCPChannelOutImpl()
Method Detail

getConnectionRetry

public int getConnectionRetry()
Description copied from interface: ChannelOutAttributeController
Returns the number of attempt to connect to ChannelIn before abording.

Specified by:
getConnectionRetry in interface ChannelOutAttributeController
Returns:
the number of attempt to connect to ChannelIn before abording.
See Also:
ChannelOutAttributeController.getConnectionRetry()

setConnectionRetry

public void setConnectionRetry(int retry)
Description copied from interface: ChannelOutAttributeController
Sets the number of attempt to connect to ChannelIn before abording.

Specified by:
setConnectionRetry in interface ChannelOutAttributeController
Parameters:
retry - the number of attempt to connect to ChannelIn before abording.
See Also:
ChannelOutAttributeController.setConnectionRetry(int)

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController
See Also:
BindingController.listFc()

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
            throws NoSuchInterfaceException,
                   IllegalBindingException,
                   IllegalLifeCycleException
Specified by:
bindFc in interface BindingController
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.bindFc(String, Object)

connectSocket

protected Socket connectSocket(InetAddress addr,
                               int port)
                        throws IOException
This method connects and returns a socket.

Parameters:
addr - the IP to connect to
port - the port number
Returns:
a socket
Throws:
IOException - if after many attempt, the connection failed, an IOException is thrown

closeSocket

protected void closeSocket(Socket out)
                    throws IOException
This method close a socket.

Parameters:
out - a socket
Throws:
IOException - if after many attempt, the connection failed, an IOException is thrown

setSocketOption

protected void setSocketOption(Socket sock)
                        throws SocketException
Configures this socket using the socket options established for this factory. It may be overloaded in subclass, in order to handle particular subclasses of sockets

Parameters:
sock - the socket.
Throws:
SocketException - for networking errors


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.