org.objectweb.dream.channel
Class MultiConnTCPChannelInImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.channel.AbstractTCPChannelInImpl
          extended byorg.objectweb.dream.channel.MultiConnTCPChannelInImpl
All Implemented Interfaces:
AttributeController, BindingController, IPChannelInAttributeController, LifeCycleController, Loggable, MultiConnTCPChannelInAttributeController

public class MultiConnTCPChannelInImpl
extends AbstractTCPChannelInImpl
implements MultiConnTCPChannelInAttributeController

ChannelIn implementation accepting multiple connection at the same time. For each connection a thread is created to read incomming messages.


Nested Class Summary
protected  class MultiConnTCPChannelInImpl.ConnectionState
           
protected  class MultiConnTCPChannelInImpl.ConnectionTask
           
protected  class MultiConnTCPChannelInImpl.InTask
           
 
Field Summary
protected  LinkedList availableSocketList
           
protected  Task connectionTask
           
protected  Task inTask
           
protected  ServerSocket listen
          The ServerSocketused by this component
protected  int maxConnection
           
protected  int nbConnection
           
protected  int soTimeout
           
protected  ThreadPoolAttributeController threadPoolAttributeController
           
protected  ThreadPoolController threadPoolController
           
 
Fields inherited from class org.objectweb.dream.channel.AbstractTCPChannelInImpl
messageCodecItf, openRetry, outPushItf, portNum
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
MultiConnTCPChannelInImpl()
           
 
Method Summary
 int getMaxConnection()
          Returns the maximum number of connections.
 int getSoTimeout()
          Returns the SO_TIMEOUT.
protected  void initComponent(Component componentItf)
           
 void setMaxConnection(int maxConnection)
          Sets the maximum number of connections.
protected  void setSocketOption(Socket sock)
          Configures this socket using the socket options established for this factory.
 void setSoTimeout(int timeout)
          Sets the SO_TIMEOUT.
 void startFc()
           
 void stopFc()
           
 
Methods inherited from class org.objectweb.dream.channel.AbstractTCPChannelInImpl
bindFc, createServerSocket, getListeningPort, getOpenRetry, listFc, sendAck, setListeningPort, setOpenRetry
 
Methods inherited from class org.objectweb.dream.AbstractComponent
getFcState, lookupFc, setLogger, 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.channel.IPChannelInAttributeController
getListeningPort, getOpenRetry, setListeningPort, setOpenRetry
 

Field Detail

listen

protected ServerSocket listen
The ServerSocketused by this component


connectionTask

protected Task connectionTask

inTask

protected Task inTask

threadPoolController

protected ThreadPoolController threadPoolController

threadPoolAttributeController

protected ThreadPoolAttributeController threadPoolAttributeController

availableSocketList

protected LinkedList availableSocketList

maxConnection

protected int maxConnection

nbConnection

protected int nbConnection

soTimeout

protected int soTimeout
Constructor Detail

MultiConnTCPChannelInImpl

public MultiConnTCPChannelInImpl()
Method Detail

initComponent

protected void initComponent(Component componentItf)
                      throws InitializationException
Throws:
InitializationException

setSocketOption

protected void setSocketOption(Socket sock)
                        throws SocketException
Description copied from class: AbstractTCPChannelInImpl
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

Overrides:
setSocketOption in class AbstractTCPChannelInImpl
Parameters:
sock - the socket.
Throws:
SocketException - for networking errors
See Also:
AbstractTCPChannelInImpl.setSocketOption(Socket)

startFc

public void startFc()
             throws IllegalLifeCycleException
Specified by:
startFc in interface LifeCycleController
Throws:
IllegalLifeCycleException
See Also:
AbstractComponent.startFc()

stopFc

public void stopFc()
            throws IllegalLifeCycleException
Specified by:
stopFc in interface LifeCycleController
Throws:
IllegalLifeCycleException
See Also:
LifeCycleController.stopFc()

getMaxConnection

public int getMaxConnection()
Description copied from interface: MultiConnTCPChannelInAttributeController
Returns the maximum number of connections.

Specified by:
getMaxConnection in interface MultiConnTCPChannelInAttributeController
Returns:
the maximum number of connections.
See Also:
MultiConnTCPChannelInAttributeController.getMaxConnection()

setMaxConnection

public void setMaxConnection(int maxConnection)
Description copied from interface: MultiConnTCPChannelInAttributeController
Sets the maximum number of connections.

Specified by:
setMaxConnection in interface MultiConnTCPChannelInAttributeController
Parameters:
maxConnection - the maximum number of connections.
See Also:
MultiConnTCPChannelInAttributeController.setMaxConnection(int)

getSoTimeout

public int getSoTimeout()
Description copied from interface: MultiConnTCPChannelInAttributeController
Returns the SO_TIMEOUT.

Specified by:
getSoTimeout in interface MultiConnTCPChannelInAttributeController
Returns:
timeout, in milliseconds.
See Also:
MultiConnTCPChannelInAttributeController.getSoTimeout()

setSoTimeout

public void setSoTimeout(int timeout)
Description copied from interface: MultiConnTCPChannelInAttributeController
Sets the SO_TIMEOUT.

Specified by:
setSoTimeout in interface MultiConnTCPChannelInAttributeController
Parameters:
timeout - timeout, in milliseconds. if negative, use default value.
See Also:
MultiConnTCPChannelInAttributeController.setSoTimeout(int)


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