org.objectweb.dream.message.codec
Class BasicNonExtensibleMessageCodecImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.message.codec.BasicNonExtensibleMessageCodecImpl
All Implemented Interfaces:
BindingController, LifeCycleController, Loggable, MessageCodec

public class BasicNonExtensibleMessageCodecImpl
extends AbstractComponent
implements MessageCodec

Encoder/decoder that can be used with PoolNonExtensibleMessageManagerImpl. It supposes that every messages are instances of the same class, and this class implements Externalizable. It also supposes that streams are ObjectInputor ObjectOutput.


Field Summary
protected  MessageManager messageManagerItf
           
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, 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
BasicNonExtensibleMessageCodecImpl()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
           
 Message decode(Object stream)
          Deserializes a message from the given stream
 void encode(Object stream, Message message)
          Encodes the given message on the given stream.
 String[] listFc()
           
 
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
 

Field Detail

messageManagerItf

protected MessageManager messageManagerItf
Constructor Detail

BasicNonExtensibleMessageCodecImpl

public BasicNonExtensibleMessageCodecImpl()
Method Detail

encode

public void encode(Object stream,
                   Message message)
            throws IOException
Description copied from interface: MessageCodec
Encodes the given message on the given stream.

Specified by:
encode in interface MessageCodec
Parameters:
stream - a stream on which the message is encoded.
message - a message to serialize.
Throws:
IOException - if an error occurs during the serialization.
See Also:
MessageCodec.encode(Object, Message)

decode

public Message decode(Object stream)
               throws IOException
Description copied from interface: MessageCodec
Deserializes a message from the given stream

Specified by:
decode in interface MessageCodec
Parameters:
stream - a stream on which the message is decoded.
Returns:
a message
Throws:
IOException - if an error occurs during the deserialization.
See Also:
MessageCodec.decode(Object)

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.