org.objectweb.dream.channel
Class SocketManagerIPChunkBasedImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.channel.SocketManagerIPChunkBasedImpl
All Implemented Interfaces:
AttributeController, BindingController, LifeCycleController, Loggable, SocketManager, SocketManagerIPChunkBasedAttributeController

public class SocketManagerIPChunkBasedImpl
extends AbstractComponent
implements SocketManager, SocketManagerIPChunkBasedAttributeController

Socket manager that retrieves sockets using an IPSocketManagerand getting IP and port in a IPChannelDestinationChunkin messages.


Field Summary
protected  IPSocketManager delegateSocketManagerItf
           
protected  boolean deleteChunk
           
protected  String destinationChunkName
           
protected  MessageManager messageManagerItf
           
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, firstStart, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.channel.SocketManager
ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
SocketManagerIPChunkBasedImpl()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
           
 boolean getDeleteChunk()
          Returns true if the destination chunk should be deleted from the message.
 String getDestinationChunkName()
          Returns the name of the chunks that contains the destination identification of the message.
 SocketState getSocket(Message message)
          Returns a socket that can be used to send message to a ChannelIn
 String[] listFc()
           
 void releaseSocket(SocketState socketState, boolean error)
          Releases the given SocketState.
 void setDeleteChunk(boolean deleteChunk)
          Set if the destination chunk should be deleted from the message.
 void setDestinationChunkName(String destinationChunkName)
          Set the name of the chunks that contains the destination identification of the message.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
beforeFirstStart, 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
 

Field Detail

deleteChunk

protected boolean deleteChunk

destinationChunkName

protected String destinationChunkName

messageManagerItf

protected MessageManager messageManagerItf

delegateSocketManagerItf

protected IPSocketManager delegateSocketManagerItf
Constructor Detail

SocketManagerIPChunkBasedImpl

public SocketManagerIPChunkBasedImpl()
Method Detail

getSocket

public SocketState getSocket(Message message)
                      throws IOException,
                             InterruptedException
Description copied from interface: SocketManager
Returns a socket that can be used to send message to a ChannelIn

Specified by:
getSocket in interface SocketManager
Parameters:
message - a message that is going to be sent to a ChannelIn
Returns:
a connection to the ChannelIn.
Throws:
InterruptedException - if the component is interrupted while waiting.
IOException - if the socket can't be opened.
See Also:
SocketManager.getSocket(Message)

releaseSocket

public void releaseSocket(SocketState socketState,
                          boolean error)
Description copied from interface: SocketManager
Releases the given SocketState.

Specified by:
releaseSocket in interface SocketManager
Parameters:
socketState - the socket state to release.
error - true if an exception has been catched while sending the message, false otherwise.
See Also:
SocketManager.releaseSocket(SocketState, boolean)

getDeleteChunk

public boolean getDeleteChunk()
Description copied from interface: SocketManagerIPChunkBasedAttributeController
Returns true if the destination chunk should be deleted from the message. The default value is true

Specified by:
getDeleteChunk in interface SocketManagerIPChunkBasedAttributeController
Returns:
true if the destination chunk should be deleted from the message.
See Also:
SocketManagerIPChunkBasedAttributeController.getDeleteChunk()

setDeleteChunk

public void setDeleteChunk(boolean deleteChunk)
Description copied from interface: SocketManagerIPChunkBasedAttributeController
Set if the destination chunk should be deleted from the message.

Specified by:
setDeleteChunk in interface SocketManagerIPChunkBasedAttributeController
Parameters:
deleteChunk - true if the destination chunk should be deleted from the message.
See Also:
SocketManagerIPChunkBasedAttributeController.setDeleteChunk(boolean)

getDestinationChunkName

public String getDestinationChunkName()
Description copied from interface: SocketManagerIPChunkBasedAttributeController
Returns the name of the chunks that contains the destination identification of the message.

Specified by:
getDestinationChunkName in interface SocketManagerIPChunkBasedAttributeController
Returns:
a chunk name.
See Also:
SocketManagerIPChunkBasedAttributeController.getDestinationChunkName()

setDestinationChunkName

public void setDestinationChunkName(String destinationChunkName)
Description copied from interface: SocketManagerIPChunkBasedAttributeController
Set the name of the chunks that contains the destination identification of the message.

Specified by:
setDestinationChunkName in interface SocketManagerIPChunkBasedAttributeController
Parameters:
destinationChunkName - a chunk name.
See Also:
SocketManagerIPChunkBasedAttributeController.setDestinationChunkName(String)

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)


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