org.objectweb.dream.message.codec
Class AbstractMessageCodecDataStream

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.message.codec.AbstractMessageCodecDataStream
All Implemented Interfaces:
BindingController, LifeCycleController, Loggable, MessageCodec
Direct Known Subclasses:
AbstractMessageCodecObjectStream

public abstract class AbstractMessageCodecDataStream
extends AbstractComponent
implements MessageCodec

Abstract implementation of a message codec using data input/output to decode/encode messages. This class implements


Field Summary
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.message.codec.MessageCodec
ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
AbstractMessageCodecDataStream()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
           
protected  Message doDecode(DataInput input)
          Decode recursively a message and its sub messages (if any).
protected abstract  Message doDecodeSingleMessage(DataInput input)
          Abstract method used by doDecode(DataInput)to decode a single message.
protected  void doEncode(Message message, DataOutput output)
          Encode recursively a message and its sub messages (if any).
protected abstract  void doEncodeSingleMessage(Message message, DataOutput output)
          Abstract method used by doEncode(Message, DataOutput)to encode a single message.
 String[] listFc()
           
 
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
 
Methods inherited from interface org.objectweb.dream.message.codec.MessageCodec
decode, encode
 

Field Detail

messageManagerItf

protected MessageManager messageManagerItf
Constructor Detail

AbstractMessageCodecDataStream

public AbstractMessageCodecDataStream()
Method Detail

doDecode

protected Message doDecode(DataInput input)
                    throws IOException
Decode recursively a message and its sub messages (if any). This method use the doDecodeSingleMessage(DataInput)method to decode a single message.

Throws:
IOException

doDecodeSingleMessage

protected abstract Message doDecodeSingleMessage(DataInput input)
                                          throws IOException
Abstract method used by doDecode(DataInput)to decode a single message. This method decode only chunks of message.

Parameters:
input - the input from which message is decoded.
Returns:
a message.
Throws:
IOException - if an error occurs.

doEncode

protected void doEncode(Message message,
                        DataOutput output)
                 throws IOException
Encode recursively a message and its sub messages (if any). This method use the doEncodeSingleMessage(Message, DataOutput)method to encode a single message.

Throws:
IOException

doEncodeSingleMessage

protected abstract void doEncodeSingleMessage(Message message,
                                              DataOutput output)
                                       throws IOException
Abstract method used by doEncode(Message, DataOutput)to encode a single message. This method encode only chunks of message.

Parameters:
message - a message to encode.
output - the output to use to encode the message.
Throws:
IOException - if an error occurs.

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
Overrides:
bindFc in class AbstractComponent
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.bindFc(String, Object)


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