org.objectweb.fractal.julia.control.binding
Class OptimizedCompositeBindingMixin

java.lang.Object
  extended by org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin
All Implemented Interfaces:
BindingController

public abstract class OptimizedCompositeBindingMixin
extends Object
implements BindingController

Provides optimized ComponentInterface management to a BindingController. This mixin uses shortcut links between component interfaces where possible, i.e. when some interfaces do not have associated interceptors.

Requirements


Field Summary
 Component _this_weaveableC
          The weaveableC field required by this mixin.
 ContentController _this_weaveableCC
          The weaveableCC field required by this mixin.
 
Method Summary
abstract  void _super_bindFc(InterfaceType clientItfType, String clientItfName, Object serverItf)
          The bindFc method overriden by this mixin.
abstract  void _super_unbindFc(InterfaceType clientItfType, String clientItfName)
          The unbindFc method overriden by this mixin.
 void bindFc(InterfaceType clientItfType, String clientItfName, Object serverItf)
          Sets the shortcuts for the given binding and then calls the overriden method.
 void setFcClientShortcuts(Interface clientItf, Object impl, Set visited, List shortcutItfs, List shortcutImpls)
          Finds the shortcut links to be updated by following the bindings backwards from the given client interface.
 void setFcServerShortcuts(Interface serverItf, Object impl, Set visited, List shortcutItfs, List shortcutImpls)
          Finds the shortcut links to be updated by followng the bindings backwards from the given server interface.
 void setFcShortcuts(InterfaceType clientItfType, String clientItfName, Object serverItf)
          Creates the given binding and updates the shortcuts links accordingly.
 void unbindFc(InterfaceType clientItfType, String clientItfName)
          Updates the shortcuts for the given binding and then calls the overriden method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.fractal.api.control.BindingController
bindFc, listFc, lookupFc, unbindFc
 

Field Detail

_this_weaveableC

public Component _this_weaveableC
The weaveableC field required by this mixin. This field is supposed to reference the Component interface of the component to which this controller object belongs.


_this_weaveableCC

public ContentController _this_weaveableCC
The weaveableCC field required by this mixin. This field is supposed to reference the ContentController interface of the component to which this controller object belongs.

Method Detail

bindFc

public void bindFc(InterfaceType clientItfType,
                   String clientItfName,
                   Object serverItf)
            throws NoSuchInterfaceException,
                   IllegalBindingException,
                   IllegalLifeCycleException
Sets the shortcuts for the given binding and then calls the overriden method.

Parameters:
clientItfType - the type of the clientItfName interface.
clientItfName - the name of a client interface of the component to which this interface belongs.
serverItf - a server interface.
Throws:
NoSuchInterfaceException - if there is no such client interface.
IllegalBindingException - if the binding cannot be created.
IllegalLifeCycleException - if this component has a LifeCycleController interface, but it is not in an appropriate state to perform this operation.

unbindFc

public void unbindFc(InterfaceType clientItfType,
                     String clientItfName)
              throws NoSuchInterfaceException,
                     IllegalBindingException,
                     IllegalLifeCycleException
Updates the shortcuts for the given binding and then calls the overriden method.

Parameters:
clientItfType - the type of the clientItfName interface.
clientItfName - the name of a client interface of the component to which this interface belongs.
Throws:
NoSuchInterfaceException - if there is no such client interface.
IllegalBindingException - if the binding cannot be removed.
IllegalLifeCycleException - if this component has a LifeCycleController interface, but it is not in an appropriate state to perform this operation.

setFcShortcuts

public void setFcShortcuts(InterfaceType clientItfType,
                           String clientItfName,
                           Object serverItf)
                    throws NoSuchInterfaceException,
                           IllegalBindingException
Creates the given binding and updates the shortcuts links accordingly.

Parameters:
clientItfType - the type of the 'clientItfName' interface.
clientItfName - a client interface name.
serverItf - the server interface to which the client interface must be bound, or null if it must be unbound.
Throws:
NoSuchInterfaceException - if there is no client interface whose name is equal to 'clientItfName'.
IllegalBindingException - if a problem occurs.

setFcClientShortcuts

public void setFcClientShortcuts(Interface clientItf,
                                 Object impl,
                                 Set visited,
                                 List shortcutItfs,
                                 List shortcutImpls)
                          throws Exception
Finds the shortcut links to be updated by following the bindings backwards from the given client interface.

Parameters:
clientItf - the client interface from which the bindings must be followed backward.
impl - the object to be used to update the shortcut links with getFcItfImpl.
visited - the already visited interfaces.
shortcutItfs - the interfaces whose shortcut links must be updated.
shortcutImpls - the values to be used to update the shortcut links.
Throws:
Exception - if a problem occurs.

setFcServerShortcuts

public void setFcServerShortcuts(Interface serverItf,
                                 Object impl,
                                 Set visited,
                                 List shortcutItfs,
                                 List shortcutImpls)
                          throws Exception
Finds the shortcut links to be updated by followng the bindings backwards from the given server interface.

Parameters:
serverItf - the server interface from which the bindings must be followed backward.
impl - the object to be used to update the shortcut links with getFcItfImpl.
visited - the already visited interfaces.
shortcutItfs - the interfaces whose shortcut links must be updated.
shortcutImpls - the values to be used to update the shortcut links.
Throws:
Exception - if a problem occurs.

_super_bindFc

public abstract void _super_bindFc(InterfaceType clientItfType,
                                   String clientItfName,
                                   Object serverItf)
                            throws NoSuchInterfaceException,
                                   IllegalBindingException,
                                   IllegalLifeCycleException
The bindFc method overriden by this mixin.

Parameters:
clientItfType - the type of the clientItfName interface.
clientItfName - the name of a client interface of the component to which this interface belongs.
serverItf - a server interface.
Throws:
NoSuchInterfaceException - if there is no such client interface.
IllegalBindingException - if the binding cannot be created.
IllegalLifeCycleException - if this component has a LifeCycleController interface, but it is not in an appropriate state to perform this operation.

_super_unbindFc

public abstract void _super_unbindFc(InterfaceType clientItfType,
                                     String clientItfName)
                              throws NoSuchInterfaceException,
                                     IllegalBindingException,
                                     IllegalLifeCycleException
The unbindFc method overriden by this mixin.

Parameters:
clientItfType - the type of the clientItfName interface.
clientItfName - the name of a client interface of the component to which this interface belongs.
Throws:
NoSuchInterfaceException - if there is no such client interface.
IllegalBindingException - if the binding cannot be removed.
IllegalLifeCycleException - if this component has a LifeCycleController interface, but it is not in an appropriate state to perform this operation.