aokell.lib.control.component
Class ComponentImpl

java.lang.Object
  extended by aokell.lib.InterfaceImpl
      extended by aokell.lib.control.component.ComponentImpl
All Implemented Interfaces:
CloneableItf, ComponentDescItf, ComponentItf, Controller, Cloneable, 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
           
 
Fields inherited from class aokell.lib.InterfaceImpl
bc
 
Fields inherited from interface aokell.lib.control.component.ComponentItf
NAME, TYPE
 
Constructor Summary
ComponentImpl()
           
 
Method Summary
 void addFcController(InterfaceType it, Controller 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()
           
protected  Object getContentPart()
           
 Object getControllerDesc()
           
 Object getFcClientInterface(String interfaceName)
          Return the instance implementing the given client interface name for this component.
 List getFcCollectionInterfaces()
           
 Controller[] getFcControllers()
          Return the array of control interfaces implemented by the component.
protected  Interface getFcInterface(InterfaceType it, Component itfOwner)
          Get the Interface instance associated to the given interface type for the given component.
 Object getFcInterface(String interfaceName)
           
 Object[] getFcInterfaces()
          Return the array of Interface instances implemented by this component.
 String getFcItfName()
           
 Component getFcItfOwner()
           
 Type getFcItfType()
           
 List getFcSingletonBusinessInterfaces()
           
 List getFcSingletonClientInterfaces()
          Return the list of client interfaces implemented by this component.
 List getFcSingletonControlInterfaces()
           
 List getFcSingletonInterfaces()
           
 Type getFcType()
           
static Interface getProxyInterface(InterfaceType it, Component itfOwner, Object content, Delegator delegator)
          Return the Interface instance associated to the given interface type.
 void initFcCtrl()
          Initialize the controller.
 boolean isFcInternalItf()
           
 void setContentDesc(Object contentDesc)
           
 void setContentPart(Object contentPart)
          Set the content associated to this component.
 void setControllerDesc(Object controllerDesc)
           
 void setFcCompCtrl(Component compctrl)
          Set the reference towards the component controller associated to this controller.
 void setType(Type type)
           
 
Methods inherited from class aokell.lib.InterfaceImpl
clone, init, lookupFc, setBC, setFcInternalItf, setFcItfName, setFcItfOwner, setFcItfType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compctrl

protected Component compctrl
Constructor Detail

ComponentImpl

public ComponentImpl()
Method Detail

getFcType

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

getFcInterface

public Object getFcInterface(String interfaceName)
                      throws NoSuchInterfaceException
Specified by:
getFcInterface in interface Component
Returns:
the instance implementing the given interface name for this component
Throws:
NoSuchInterfaceException

getFcInterfaces

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

Specified by:
getFcInterfaces in interface Component

getControllerDesc

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

getContentDesc

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

setType

public void setType(Type type)
Specified by:
setType in interface ComponentItf

setContentDesc

public void setContentDesc(Object contentDesc)
Specified by:
setContentDesc in interface ComponentItf

setControllerDesc

public void setControllerDesc(Object controllerDesc)
Specified by:
setControllerDesc in interface ComponentItf

getFcControllers

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

Specified by:
getFcControllers in interface ComponentItf

addFcController

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

Specified by:
addFcController in interface ComponentItf

getFcSingletonClientInterfaces

public List getFcSingletonClientInterfaces()
Return the list of client interfaces implemented by this component.

Specified by:
getFcSingletonClientInterfaces in interface ComponentItf

getFcClientInterface

public Object getFcClientInterface(String interfaceName)
                            throws NoSuchInterfaceException
Return the instance implementing the given client interface name for this component. This method is a clone for getFcInterface(String).

Specified by:
getFcClientInterface in interface ComponentItf
Throws:
NoSuchInterfaceException

getFcSingletonInterfaces

public List getFcSingletonInterfaces()
Specified by:
getFcSingletonInterfaces in interface ComponentItf
Returns:
the list of singleton Interface instances implemented by this component

getFcSingletonBusinessInterfaces

public List getFcSingletonBusinessInterfaces()
Specified by:
getFcSingletonBusinessInterfaces in interface ComponentItf
Returns:
the list of singleton business Interface instances implemented by this component

getFcSingletonControlInterfaces

public List getFcSingletonControlInterfaces()
Specified by:
getFcSingletonControlInterfaces in interface ComponentItf
Returns:
the list of singleton control Interface instances implemented by this component

getFcCollectionInterfaces

public List getFcCollectionInterfaces()
Specified by:
getFcCollectionInterfaces in interface ComponentItf
Returns:
the list of collection Interface instances implemented by this component

getFcInterface

protected Interface getFcInterface(InterfaceType it,
                                   Component itfOwner)
Get the Interface instance associated to the given interface type for the given component.


getProxyInterface

public static Interface getProxyInterface(InterfaceType it,
                                          Component itfOwner,
                                          Object content,
                                          Delegator delegator)
Return the Interface instance associated to the given interface type. The returned instance implements both the Interface interface and the Java interface specified in the given interface type. The instance is a proxy generated with ASM.

Parameters:
it - the interface type
itfOwner - the component owning this interface
content - the instance implementing the content
delegator - the class used to generate the proxy methods
Returns:
the interface

setContentPart

public void setContentPart(Object contentPart)
Description copied from interface: ComponentItf
Set the content associated to this component.

Specified by:
setContentPart in interface ComponentItf

getContentPart

protected Object getContentPart()

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