org.objectweb.fractal.aokell.lib.control.content
Class ContentControllerImpl

java.lang.Object
  extended by org.objectweb.fractal.aokell.lib.control.content.ContentControllerImpl
All Implemented Interfaces:
ContentControllerItf, Controller, ContentController
Direct Known Subclasses:
TemplateContentControllerImpl

public class ContentControllerImpl
extends Object
implements ContentControllerItf, Controller

Implementation for the ContentController.

Author:
Lionel Seinturier

Field Summary
 
Fields inherited from interface org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf
NAME, TYPE
 
Constructor Summary
ContentControllerImpl()
           
 
Method Summary
 void addFcController(InterfaceType[] it, Object ctrl)
          Declare a new controller implemented by the component.
 void addFcSubComponent(Component arg0)
           
 void cloneFcCtrl(Component dst, Object hints)
          Clone the controller state from the current component to another one.
 Object getFcInternalInterface(String interfaceName)
           
 Object[] getFcInternalInterfaces()
          Return the array of internal Interface instances implemented by this component.
 Component[] getFcSubComponents()
           
 void initFc(Type type, Object controllerDesc, Object contentDesc, Component compctrlimpl, Object contentPart)
          Initialize parameters required for managing internal interfaces associated with this content controller.
 void initFcCtrl()
          Initialize the controller.
static boolean isFcContainedIn(boolean recurse, Component src, Component dst)
          Return true if the given src component is contained in the given dst component.
 Interface registerFcInterface(String interfaceName)
          Register a new collection Interface instance.
 void removeFcSubComponent(Component arg0)
           
 void setFcCompCtrl(Component compctrl)
          Set the reference towards the component controller associated to this controller.
protected  void testLifeCyleBeforeRemoving(Component arg0)
           
 void unregisterFcInterface(String interfaceName)
          Unregister a collection Interface instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentControllerImpl

public ContentControllerImpl()
Method Detail

getFcInternalInterfaces

public Object[] getFcInternalInterfaces()
Return the array of internal Interface instances implemented by this component.

Specified by:
getFcInternalInterfaces in interface ContentController

getFcInternalInterface

public Object getFcInternalInterface(String interfaceName)
                              throws NoSuchInterfaceException
Specified by:
getFcInternalInterface in interface ContentController
Throws:
NoSuchInterfaceException

getFcSubComponents

public Component[] getFcSubComponents()
Specified by:
getFcSubComponents in interface ContentController

addFcSubComponent

public void addFcSubComponent(Component arg0)
                       throws IllegalContentException,
                              IllegalLifeCycleException
Specified by:
addFcSubComponent in interface ContentController
Throws:
IllegalContentException
IllegalLifeCycleException

removeFcSubComponent

public void removeFcSubComponent(Component arg0)
                          throws IllegalContentException,
                                 IllegalLifeCycleException
Specified by:
removeFcSubComponent in interface ContentController
Throws:
IllegalContentException
IllegalLifeCycleException

addFcController

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

Specified by:
addFcController in interface ContentControllerItf

initFc

public void initFc(Type type,
                   Object controllerDesc,
                   Object contentDesc,
                   Component compctrlimpl,
                   Object contentPart)
Initialize parameters required for managing internal interfaces associated with this content controller. This method is invoked by the membrane factory.

Specified by:
initFc in interface ContentControllerItf

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 ContentControllerItf
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 ContentControllerItf
Parameters:
interfaceName - the interface name (e.g. foo004)
Throws:
NoSuchInterfaceException - if there is no such collection interface

testLifeCyleBeforeRemoving

protected void testLifeCyleBeforeRemoving(Component arg0)
                                   throws IllegalLifeCycleException
Throws:
IllegalLifeCycleException

isFcContainedIn

public static boolean isFcContainedIn(boolean recurse,
                                      Component src,
                                      Component dst)
Return true if the given src component is contained in the given dst component.

Parameters:
recurse - true if the search must be recursive
src - the source component
dst - the destination component
Returns:
true if src is contained in dst

setFcCompCtrl

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

Specified by:
setFcCompCtrl in interface Controller

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