org.objectweb.fractal.aokell.lib.interf
Class PrimitiveExtItfManager

java.lang.Object
  extended by org.objectweb.fractal.aokell.lib.interf.PrimitiveExtItfManager
All Implemented Interfaces:
InterfaceManager
Direct Known Subclasses:
CompositeExtItfManager

public class PrimitiveExtItfManager
extends Object
implements InterfaceManager

A manager for external interfaces of primitive components.

Author:
Lionel Seinturier

Field Summary
protected  Component compctrlimpl
           
protected  Object content
           
protected  ComponentType type
           
 
Constructor Summary
PrimitiveExtItfManager()
           
 
Method Summary
protected  Interface getFcInterface(InterfaceType it, Component itfOwner, Object content, boolean isFcInternalInterface)
          Get the Interface instance associated to the given interface type for the given 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.
protected  Interface getProxyInterface(InterfaceType it, Component itfOwner, Object content, boolean isFcInternalInterface, boolean boundable)
          Return an Interface instance for the given interface type.
 void initFc(Type type, Component compctrlimpl, Object content)
           
 Interface[] registerFcControlInterface(InterfaceType[] its, Object ctrl)
          Register new control interfaces for a given controller.
 Interface registerFcInterface(String interfaceName)
          Register a new collection Interface instance.
 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
 

Field Detail

compctrlimpl

protected Component compctrlimpl

type

protected ComponentType type

content

protected Object content
Constructor Detail

PrimitiveExtItfManager

public PrimitiveExtItfManager()
Method Detail

initFc

public void initFc(Type type,
                   Component compctrlimpl,
                   Object content)
Specified by:
initFc in interface InterfaceManager

getFcInterface

public Object getFcInterface(String interfaceName)
                      throws NoSuchInterfaceException
Return the instance implementing the Interface corresponding to the given name. The returned value is of type Object to be compatible with the Component interface.

Specified by:
getFcInterface in interface InterfaceManager
Throws:
NoSuchInterfaceException

getFcInterfaces

public Object[] getFcInterfaces()
Return the array of Interface instances implemented by this component. The returned values are of type Object to be compatible with the Component interface.

Specified by:
getFcInterfaces in interface InterfaceManager

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

registerFcControlInterface

public Interface[] registerFcControlInterface(InterfaceType[] its,
                                              Object ctrl)
Register new control interfaces for a given controller. Most of the time a controller implements only one control interface. One exception is the factory controller which implements the interface type corresponding to Factory and the interface type corresponding to Template.

Specified by:
registerFcControlInterface in interface InterfaceManager
Parameters:
its - the interface types
ctrl - the controller
Returns:
the interface instances

getFcInterface

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


getProxyInterface

protected final Interface getProxyInterface(InterfaceType it,
                                            Component itfOwner,
                                            Object content,
                                            boolean isFcInternalInterface,
                                            boolean boundable)
Return an Interface instance for 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 when the fcinterface feature is set to asm.

Parameters:
it - the interface type
itfOwner - the component owning this interface
content - the instance implementing the content
boundable - true if the interface can be bound (e.g. client for a primitive) false otherwise (e.g. server for a primitive)
Returns:
the interface instance