org.objectweb.dream.message.codec
Class BasicCodecManagerImpl

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

public class BasicCodecManagerImpl
extends AbstractComponent
implements CodecManager

Basic implementation of codec manager. Use a CodecRepositoryto associate codec name with ADL.


Field Summary
protected  CodecRepository codecRepositoryItf
           
static String CODECS_COMPONENT_ITF_NAME
          The name of the client interface bound to the component interface of the composite containning codecs.
protected  ContentController codecsCCItf
           
protected  Component codecsCompositeItf
           
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.message.codec.CodecManager
ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
BasicCodecManagerImpl()
           
 
Method Summary
 void addCodec(String codecName, Object hints)
          Adds a codec component for the specified codec name.
 void bindFc(String clientItfName, Object serverItf)
           
protected  void createCodec(String codecName, String codecADL, Object hints)
          Creates a codec and adds it in the codecs composite
protected  Component findCodec(String codecName)
          Finds and returns a codec component with the specified name.
 Component getCodec(String codecName)
          Returns the codec component for the given codec name.
 String[] listFc()
           
 void removeCodec(String codecName)
          Removes a codec component.
 
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

CODECS_COMPONENT_ITF_NAME

public static final String CODECS_COMPONENT_ITF_NAME
The name of the client interface bound to the component interface of the composite containning codecs.

See Also:
Constant Field Values

codecRepositoryItf

protected CodecRepository codecRepositoryItf

codecsCompositeItf

protected Component codecsCompositeItf

codecsCCItf

protected ContentController codecsCCItf
Constructor Detail

BasicCodecManagerImpl

public BasicCodecManagerImpl()
Method Detail

addCodec

public void addCodec(String codecName,
                     Object hints)
              throws CodecManagerException
Description copied from interface: CodecManager
Adds a codec component for the specified codec name. If a codec component for the given codec name is already present, this method do nothig.

Specified by:
addCodec in interface CodecManager
Parameters:
codecName - the name of the codec.
hints - additional parameters.
Throws:
CodecManagerException - if the manager can't add the codec.
See Also:
CodecManager.addCodec(String, Object)

removeCodec

public void removeCodec(String codecName)
                 throws CodecManagerException
Description copied from interface: CodecManager
Removes a codec component. The codec component must not be in use (i.e. the component is not shared by different composites).

Specified by:
removeCodec in interface CodecManager
Parameters:
codecName - the name of the codec.
Throws:
CodecManagerException - the the given codec name is unknown, or if the codec component is in use.
See Also:
CodecManager.removeCodec(String)

getCodec

public Component getCodec(String codecName)
                   throws CodecManagerException
Description copied from interface: CodecManager
Returns the codec component for the given codec name.

Specified by:
getCodec in interface CodecManager
Parameters:
codecName - the name of the codec.
Returns:
the codec component for the given codec name.
Throws:
CodecManagerException - the the given codec name is unknown.
See Also:
CodecManager.getCodec(String)

findCodec

protected Component findCodec(String codecName)
Finds and returns a codec component with the specified name. If the codec can't be found, returns null.


createCodec

protected void createCodec(String codecName,
                           String codecADL,
                           Object hints)
                    throws CodecManagerException
Creates a codec and adds it in the codecs composite

Throws:
CodecManagerException

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.