org.objectweb.fractal.aokell.lib.control.component
Class ComponentImpl

java.lang.Object
  extended by org.objectweb.fractal.aokell.lib.InterfaceImpl
      extended by org.objectweb.fractal.aokell.lib.control.component.ComponentImpl
All Implemented Interfaces:
ComponentDescItf, ComponentItf, Controller, Component, Interface
Direct Known Subclasses:
CompositeComponentImpl

public class ComponentImpl
extends InterfaceImpl
implements ComponentItf, ComponentDescItf, Controller

Root class for implementations of the Component interface. This class contains common features shared by all classes implementing this interface.

Author:
Lionel Seinturier

Field Summary
protected  Component compctrl
           
protected  InterfaceManager im
          The interfaces managed by this component.
 
Fields inherited from class org.objectweb.fractal.aokell.lib.InterfaceImpl
bc, fcContent
 
Fields inherited from interface org.objectweb.fractal.aokell.lib.control.component.ComponentItf
NAME, TYPE
 
Constructor Summary
ComponentImpl()
           
 
Method Summary
 void addFcController(InterfaceType[] it, Object ctrl)
          Declare a new controller implemented by the component.
 void cloneFcCtrl(Component dst, Object hints)
          Clone the controller state from the current component to another one.
 Object getContentDesc()
           
 Object getControllerDesc()
           
 Object[] getFcControllers()
          Return the array of control interfaces implemented by the component.
 Object getFcInterface(String interfaceName)
          Return the instance implementing the Interface corresponding to the given name.
 Object[] getFcInterfaces()
          Return the array of Interface instances implemented by this component.
 String getFcItfName()
           
 Component getFcItfOwner()
           
 Type getFcItfType()
           
 Type getFcType()
           
 void initFc(Type type, Object controllerDesc, Object contentDesc, Object contentPart)
           
 void initFcCtrl()
          Initialize the controller.
 boolean isFcInternalItf()
           
 Interface registerFcInterface(String interfaceName)
          Register a new collection Interface instance.
 void setFcCompCtrl(Component compctrl)
          Set the reference towards the component controller associated to this controller.
 void unregisterFcInterface(String interfaceName)
          Unregister a collection Interface instance.
 
Methods inherited from class org.objectweb.fractal.aokell.lib.InterfaceImpl
clone, init, lookupFc, setBC, setFcInternalItf, setFcItfImpl, setFcItfName, setFcItfOwner, setFcItfType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

im

protected InterfaceManager im
The interfaces managed by this component.


compctrl

protected Component compctrl
Constructor Detail

ComponentImpl

public ComponentImpl()
Method Detail

getFcInterface

public Object getFcInterface(String interfaceName)
                      throws NoSuchInterfaceException
Return the instance implementing the Interface corresponding to the given name. Whereas this is the case most of the time, it is not mandatory for the returned value to be of type Interface.

Specified by:
getFcInterface in interface Component
Throws:
NoSuchInterfaceException

getFcInterfaces

public Object[] getFcInterfaces()
Return the array of Interface instances implemented by this component. Whereas this is the case most of the time, it is not mandatory for the returned values to be of type Interface.

Specified by:
getFcInterfaces in interface Component

getFcType

public Type getFcType()
Specified by:
getFcType in interface Component

getControllerDesc

public Object getControllerDesc()
Specified by:
getControllerDesc in interface ComponentDescItf

getContentDesc

public Object getContentDesc()
Specified by:
getContentDesc in interface ComponentDescItf

initFc

public void initFc(Type type,
                   Object controllerDesc,
                   Object contentDesc,
                   Object contentPart)
Specified by:
initFc in interface ComponentItf

getFcControllers

public Object[] getFcControllers()
Return the array of control interfaces implemented by the component.

Specified by:
getFcControllers in interface ComponentItf

addFcController

public void addFcController(InterfaceType[] it,
                            Object ctrl)
Declare a new controller implemented by the component.

Specified by:
addFcController in interface ComponentItf
Parameters:
it - the control interface types implemented by this controller
ctrl - the controller. The controller (i.e. the instance of Controller) with object-oriented membranes. The proxy interface with componentized membranes.

registerFcInterface

public Interface registerFcInterface(String interfaceName)
                              throws NoSuchInterfaceException
Register a new collection Interface instance. The given name must start with an existing collection interface name decalred in the component type.

Specified by:
registerFcInterface in interface ComponentItf
Parameters:
interfaceName - the interface name (e.g. foo004)
Throws:
NoSuchInterfaceException - if there is no such collection interface

unregisterFcInterface

public void unregisterFcInterface(String interfaceName)
                           throws NoSuchInterfaceException
Unregister a collection Interface instance. The given name must start with an existing collection interface name decalred in the component type.

Specified by:
unregisterFcInterface in interface ComponentItf
Parameters:
interfaceName - the interface name (e.g. foo004)
Throws:
NoSuchInterfaceException - if there is no such collection interface

getFcItfName

public String getFcItfName()
Specified by:
getFcItfName in interface Interface
Overrides:
getFcItfName in class InterfaceImpl

getFcItfOwner

public Component getFcItfOwner()
Specified by:
getFcItfOwner in interface Interface
Overrides:
getFcItfOwner in class InterfaceImpl

getFcItfType

public Type getFcItfType()
Specified by:
getFcItfType in interface Interface
Overrides:
getFcItfType in class InterfaceImpl

isFcInternalItf

public boolean isFcInternalItf()
Specified by:
isFcInternalItf in interface Interface
Overrides:
isFcInternalItf in class InterfaceImpl

setFcCompCtrl

public void setFcCompCtrl(Component compctrl)
Set the reference towards the component controller associated to this controller.

Specified by:
setFcCompCtrl in interface Controller
Parameters:
compctrl - the component controller associated with this controller For instances of this class, compctrl and this are equals (the component controller is associated with itself).

initFcCtrl

public void initFcCtrl()
Initialize the controller.

Specified by:
initFcCtrl in interface Controller

cloneFcCtrl

public void cloneFcCtrl(Component dst,
                        Object hints)
                 throws CloneCtrlException
Clone the controller state from the current component to another one. This method may receive some hints on how to do this, or provide some hints on how this has been done. For instance, the hints may be a map that is read and/or written by the controller. The raison d'etre of these hints is that when its state is cloned, a controller may produce results that are needed by other controllers.

Specified by:
cloneFcCtrl in interface Controller
Parameters:
dst - the destination component
hints - hints for performing the operation
Throws:
CloneCtrlException