org.objectweb.dream.channel
Class MonoDestinationTCPChannelOutImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.channel.AbstractTCPChannelOutImpl
          extended byorg.objectweb.dream.channel.MonoDestinationTCPChannelOutImpl
All Implemented Interfaces:
AttributeController, BindingController, ChannelOutAttributeController, LifeCycleController, Loggable, MonoDestinationIPChannelOutAttributeController, Push

public class MonoDestinationTCPChannelOutImpl
extends AbstractTCPChannelOutImpl
implements MonoDestinationIPChannelOutAttributeController

Basic implementation of a ChannelOut component, using TCP protocol. Messages are sent to one destination, which can be changed using the controller.


Field Summary
protected  InetAddress inetAddress
          The inet address to which messages are sent.
protected  ObjectOutputStream oos
          The output stram that is used to send messages.
protected  int port
          The port to which messages are sent.
protected  Socket sock
          The socket that is used to send messages.
 
Fields inherited from class org.objectweb.dream.channel.AbstractTCPChannelOutImpl
cnxRetry, messageCodecItf, 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
MonoDestinationTCPChannelOutImpl()
           
 
Method Summary
 String getInetAddress()
          Returns the inet address to which messages are sent.
 int getPort()
          Returns the port number to which messages are sent.
 void push(Message message, Map context)
           
protected  void receiveAck(Socket sock)
          Does not do anything.
 void setInetAddress(String inetAddress)
          Sets the inet address to which messages are sent.
 void setPort(int port)
          Sets the port number to which messages are sent.
 
Methods inherited from class org.objectweb.dream.channel.AbstractTCPChannelOutImpl
bindFc, closeSocket, connectSocket, getConnectionRetry, listFc, setConnectionRetry, setSocketOption
 
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.channel.ChannelOutAttributeController
getConnectionRetry, setConnectionRetry
 

Field Detail

inetAddress

protected InetAddress inetAddress
The inet address to which messages are sent.


port

protected int port
The port to which messages are sent.


sock

protected Socket sock
The socket that is used to send messages.


oos

protected ObjectOutputStream oos
The output stram that is used to send messages.

Constructor Detail

MonoDestinationTCPChannelOutImpl

public MonoDestinationTCPChannelOutImpl()
Method Detail

push

public void push(Message message,
                 Map context)
          throws PushException
Specified by:
push in interface Push
Throws:
PushException
See Also:
Push.push(Message, Map)

getInetAddress

public String getInetAddress()
Description copied from interface: MonoDestinationIPChannelOutAttributeController
Returns the inet address to which messages are sent.

Specified by:
getInetAddress in interface MonoDestinationIPChannelOutAttributeController
Returns:
a string representation of the inet address to which messages are sent.
See Also:
MonoDestinationIPChannelOutAttributeController.getInetAddress()

setInetAddress

public void setInetAddress(String inetAddress)
                    throws UnknownHostException,
                           IOException
Description copied from interface: MonoDestinationIPChannelOutAttributeController
Sets the inet address to which messages are sent.

Specified by:
setInetAddress in interface MonoDestinationIPChannelOutAttributeController
Parameters:
inetAddress - a String representing the inet address.
Throws:
IOException - if an error occurs while closing the previously used socket.
UnknownHostException - if the given inet address can't be resolved.
See Also:
MonoDestinationIPChannelOutAttributeController.setInetAddress(String)

getPort

public int getPort()
Description copied from interface: MonoDestinationIPChannelOutAttributeController
Returns the port number to which messages are sent.

Specified by:
getPort in interface MonoDestinationIPChannelOutAttributeController
Returns:
the port number to which messages are sent.
See Also:
MonoDestinationIPChannelOutAttributeController.getPort()

setPort

public void setPort(int port)
Description copied from interface: MonoDestinationIPChannelOutAttributeController
Sets the port number to which messages are sent.

Specified by:
setPort in interface MonoDestinationIPChannelOutAttributeController
Parameters:
port - the port number to which messages are sent.
See Also:
MonoDestinationIPChannelOutAttributeController.setPort(int)

receiveAck

protected void receiveAck(Socket sock)
                   throws IOException
Does not do anything.

Parameters:
sock - the socket to be used.
Throws:
IOException - if an error occurs.


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