All Downloads are FREE. Search and download functionalities are using the official Maven repository.

juliac.generated.ContainerBindingControllerImpl Maven / Gradle / Ivy

package juliac.generated;

import org.objectweb.fractal.api.control.BindingController;
import org.objectweb.fractal.julia.control.binding.ChainedIllegalBindingException;
import org.objectweb.fractal.julia.control.lifecycle.ChainedIllegalLifeCycleException;
import org.objectweb.fractal.julia.ChainedNoSuchInterfaceException;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.julia.ComponentInterface;
import org.objectweb.fractal.api.type.ComponentType;
import org.objectweb.fractal.julia.control.binding.ContentBindingController;
import org.objectweb.fractal.api.control.ContentController;
import org.objectweb.fractal.julia.Controller;
import org.objectweb.fractal.julia.loader.Generated;
import org.objectweb.fractal.api.control.IllegalBindingException;
import org.objectweb.fractal.api.control.IllegalLifeCycleException;
import org.objectweb.fractal.julia.InitializationContext;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.julia.Interceptor;
import org.objectweb.fractal.api.Interface;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.api.control.LifeCycleController;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.SuperController;
import org.objectweb.fractal.api.Type;

/** 
 * @see org.objectweb.fractal.julia.BasicControllerMixin
 * @see org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin
 * @see org.objectweb.fractal.julia.UseComponentMixin
 * @see org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin
 * @see org.objectweb.fractal.julia.control.binding.CheckBindingMixin
 * @see org.objectweb.fractal.julia.control.binding.TypeBindingMixin
 * @see org.objectweb.fractal.julia.control.content.UseSuperControllerMixin
 * @see org.objectweb.fractal.julia.control.binding.ContentBindingMixin
 * @see org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin
 * @see org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin
 */
public class ContainerBindingControllerImpl implements BindingController , Controller , Generated {
    /** 
     * The {@link Component} interface of the component to which this controller
     * object belongs.
     * @see org.objectweb.fractal.julia.UseComponentMixin#weaveableC
     */
    public Component weaveableC;
    
    /** 
     * Does nothing.
     * 
     * @param ic information about the component to which this controller object
     *      belongs.
     * @throws InstantiationException if the initialization fails.
     * @see org.objectweb.fractal.julia.BasicControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext)
     */
    private void initFcController$3(final InitializationContext ic) throws InstantiationException {
    }
    
    /** 
     * The {@link SuperController} interface of the component to which this
     * controller object belongs.
     * @see org.objectweb.fractal.julia.control.content.UseSuperControllerMixin#weaveableSC
     */
    public SuperController weaveableSC;
    
    /** 
     * The {@link LifeCycleController} interface of the component to which this
     * controller object belongs.
     * @see org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin#weaveableOptLC
     */
    public LifeCycleController weaveableOptLC;
    
    /** 
     * The {@link Component} interface of the component to which this controller
     * object belongs.
     * @see org.objectweb.fractal.julia.UseComponentMixin#weaveableOptC
     */
    public Component weaveableOptC;
    
    /** 
     * The "user component" encapsulated in this container component.
     * @see org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin#fcContent
     */
    public Object fcContent;
    
    /** 
     * Checks that the given interface is unbound, and then calls the overriden
     * method.
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @param serverItf a server interface.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be created.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but it is not in an appropriate state
     *      to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.CheckBindingMixin#bindFc(java.lang.String,java.lang.Object)
     */
    private void bindFc$0(final String clientItfName, final Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        if ((lookupFc(clientItfName)) != null) {
            throw new ChainedIllegalBindingException(null , weaveableOptC , null , clientItfName , null , "Already bound");
        } 
        bindFc$1(clientItfName ,serverItf);
    }
    
    /** 
     * Initializes the fields of this mixin and then calls the overriden method.
     *
     * @param ic information about the component to which this controller object
     *      belongs.
     * @throws InstantiationException if the initialization fails.
     * @see org.objectweb.fractal.julia.control.content.UseSuperControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext)
     */
    private void initFcController$0(final InitializationContext ic) throws InstantiationException {
        weaveableSC = ((SuperController)(ic.getInterface("super-controller")));
        initFcController$1(ic);
    }
    
    /** 
     * Initializes the fields of this mixin and then calls the overriden method.
     * 
     * @param ic information about the component to which this controller object
     *      belongs.
     * @throws InstantiationException if the initialization fails.
     * @see org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext)
     */
    public void initFcController(final InitializationContext ic) throws InstantiationException {
        weaveableOptLC = ((LifeCycleController)(ic.getOptionalInterface("lifecycle-controller")));
        initFcController$0(ic);
    }
    
    /** 
     * Checks that the component is stopped and then calls the overriden method.
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be removed.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      LifeCycleController} interface, but it is not in an appropriate state
     *      to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin#unbindFc(java.lang.String)
     */
    public void unbindFc(final String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        if ((weaveableOptLC) != null) {
            String state = weaveableOptLC.getFcState();
            if (!(LifeCycleController.STOPPED.equals(state))) {
                throw new ChainedIllegalLifeCycleException(null , weaveableOptC , "The component is not stopped");
            } 
        } 
        unbindFc$0(clientItfName);
    }
    
    /** 
     * Initializes the fields of this mixin and then calls the overriden method.
     * 
     * @param ic information about the component to which this controller object
     *      belongs.
     * @throws InstantiationException if the initialization fails.
     * @see org.objectweb.fractal.julia.UseComponentMixin#initFcController(org.objectweb.fractal.julia.InitializationContext)
     */
    private void initFcController$1(final InitializationContext ic) throws InstantiationException {
        weaveableC = ((Component)(ic.getInterface("component")));
        weaveableOptC = weaveableC;
        initFcController$2(ic);
    }
    
    /** 
     * Initializes the fields of this mixin and then calls the overriden method.
     *
     * @param ic information about the component to which this controller object
     *      belongs.
     * @throws InstantiationException if the initialization fails.
     * @see org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext)
     */
    private void initFcController$2(final InitializationContext ic) throws InstantiationException {
        fcContent = ic.content;
        Component owner = ((Component)(ic.getOptionalInterface("component")));
        if (owner != null) {
            try {
                owner = ((Component)(owner.getFcInterface("component")));
                if ((fcContent) == (this)) {
                    if ((this) instanceof ContentBindingController) {
                        ((ContentBindingController)(this)).bindFcContent("component" ,owner);
                    } 
                } else if ((fcContent) instanceof BindingController) {
                    ((BindingController)(fcContent)).bindFc("component" ,owner);
                } 
            } catch (Exception ignored) {
            }
        } 
        initFcController$3(ic);
    }
    
    /** 
     * Calls the overriden method and returns the corresponding {@link
     * Interceptor#getFcItfDelegate getFcItfDelegate} (if the result is an {@link
     * Interceptor}).
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @return the server interface to which the given interface is bound, or 
     *      null if it is not bound.
     * @throws NoSuchInterfaceException if the component to which this interface
     *      belongs does not have a client interface whose name is equal to the
     *      given name.
     * @see org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin#lookupFc(java.lang.String)
     */
    private Object lookupFc$0(final String clientItfName) throws NoSuchInterfaceException {
        Object o = lookupFc$1(clientItfName);
        if (o instanceof Interceptor) {
            o = ((Interceptor)(o)).getFcItfDelegate();
        } 
        return o;
    }
    
    /** 
     * Checks the interface name with the component's type and then calls the
     * {@link #lookupFc(InterfaceType,String) lookupFc} method.
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @return the server interface to which the given interface is bound, or 
     *      null if it is not bound.
     * @throws NoSuchInterfaceException if the component to which this interface
     *      belongs does not have a client interface whose name is equal to the
     *      given name.
     * @see org.objectweb.fractal.julia.control.binding.TypeBindingMixin#lookupFc(java.lang.String)
     */
    public Object lookupFc(final String clientItfName) throws NoSuchInterfaceException {
        ComponentType compType = ((ComponentType)(weaveableC.getFcType()));
        InterfaceType clientItfType;
        try {
            clientItfType = compType.getFcInterfaceType(clientItfName);
        } catch (NoSuchInterfaceException e) {
            throw new ChainedNoSuchInterfaceException(null , weaveableC , clientItfName);
        }
        checkFcClientInterface(clientItfType);
        return lookupFc(clientItfType ,clientItfName);
    }
    
    /** 
     * Calls the {@link #checkFcLocalBinding checkFcLocalBinding} method and then
     * calls the overriden method.
     *
     * @param clientItfType the type of the clientItfName interface.
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @param serverItf a server interface.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be created.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but
     *      it is not in an appropriate state to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.ContentBindingMixin#bindFc(org.objectweb.fractal.api.type.InterfaceType,java.lang.String,java.lang.Object)
     */
    public void bindFc(final InterfaceType clientItfType, final String clientItfName, final Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        checkFcLocalBinding(clientItfType ,clientItfName ,serverItf);
        bindFc$0(clientItfType ,clientItfName ,serverItf);
    }
    
    /** 
     * The {@link Controller#initFcController initFcController} method overriden
     * by this mixin.
     * 
     * @param ic information about the component to which this controller object
     *      belongs.
     * @throws InstantiationException if the initialization fails.
     */
    private void initFcController$4(InitializationContext ic) throws InstantiationException {
    }
    
    /** 
     * Checks that the given interface is bound, and then calls the overriden
     * method.
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be removed.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but it is not in an appropriate state
     *      to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.CheckBindingMixin#unbindFc(java.lang.String)
     */
    private void unbindFc$1(final String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        if ((lookupFc(clientItfName)) == null) {
            throw new ChainedIllegalBindingException(null , weaveableOptC , null , clientItfName , null , "Not bound");
        } 
        unbindFc$2(clientItfName);
    }
    
    /** 
     * @see org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin#listFc()
     */
    public String[] listFc() {
        if ((fcContent) == (this)) {
            if ((this) instanceof ContentBindingController) {
                return ((ContentBindingController)(this)).listFcContent();
            } 
        } else if ((fcContent) instanceof BindingController) {
            return ((BindingController)(fcContent)).listFc();
        } 
        return new String[0];
    }
    
    /** 
     * Gets the interceptor of the given client interface, updates its {@link
     * Interceptor#getFcItfDelegate getFcItfDelegate}, and then calls the
     * overriden method with the interceptor as server interface (if there is
     * an interceptor for the client interface).
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @param serverItf a server interface.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be created.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but it is not in an appropriate state
     *      to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin#bindFc(java.lang.String,java.lang.Object)
     */
    private void bindFc$1(final String clientItfName, final Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        Object o = weaveableC.getFcInterface(clientItfName);
        if (o instanceof ComponentInterface) {
            Object next = ((ComponentInterface)(o)).getFcItfImpl();
            if (next instanceof Interceptor) {
                ((Interceptor)(next)).setFcItfDelegate(serverItf);
                o = next;
            } else {
                ((ComponentInterface)(o)).setFcItfImpl(serverItf);
                o = serverItf;
            }
        } else {
            o = serverItf;
        }
        bindFc$2(clientItfName ,o);
    }
    
    /** 
     * Checks that the given binding is a local binding.
     *
     * @param clientItfType the type of the clientItfName interface.
     * @param clientItfName the name of a client interface.
     * @param serverItf a server interface.
     * @throws IllegalBindingException if the given binding is not a local
     *      binding.
     * @see org.objectweb.fractal.julia.control.binding.ContentBindingMixin#checkFcLocalBinding(org.objectweb.fractal.api.type.InterfaceType,java.lang.String,java.lang.Object)
     */
    public void checkFcLocalBinding(final InterfaceType clientItfType, final String clientItfName, final Object serverItf) throws IllegalBindingException {
        Interface sItf;
        Component sComp;
        try {
            sItf = ((Interface)(serverItf));
            sComp = sItf.getFcItfOwner();
        } catch (ClassCastException e) {
            return ;
        }
        Component[] cParents = weaveableSC.getFcSuperComponents();
        String msg;
        if (!(clientItfType.isFcClientItf())) {
            ContentController cc;
            try {
                cc = ((ContentController)(weaveableC.getFcInterface("content-controller")));
            } catch (NoSuchInterfaceException e) {
                return ;
            }
            Component[] cSubComps = cc.getFcSubComponents();
            for (int i = 0 ; i < (cSubComps.length) ; ++i) {
                if (cSubComps[i].equals(sComp)) {
                    return ;
                } 
            }
            Component thisComp;
            try {
                thisComp = ((Component)(weaveableC.getFcInterface("component")));
            } catch (NoSuchInterfaceException e) {
                throw new ChainedIllegalBindingException(e , weaveableC , sItf.getFcItfOwner() , clientItfName , sItf.getFcItfName() , "Cannot get the Component interface of the client component");
            }
            if ((sComp.equals(thisComp)) && (sItf.isFcInternalItf())) {
                return ;
            } 
            msg = "Invalid export binding";
        } else if (sItf.isFcInternalItf()) {
            for (int i = 0 ; i < (cParents.length) ; ++i) {
                if (sComp.equals(cParents[i])) {
                    return ;
                } 
            }
            msg = "Invalid import binding";
        } else {
            SuperController sCompSC;
            try {
                sCompSC = ((SuperController)(sComp.getFcInterface("super-controller")));
            } catch (NoSuchInterfaceException e) {
                return ;
            }
            Component[] sParents = sCompSC.getFcSuperComponents();
            for (int i = 0 ; i < (cParents.length) ; ++i) {
                for (int j = 0 ; j < (sParents.length) ; ++j) {
                    if (cParents[i].equals(sParents[j])) {
                        return ;
                    } 
                }
            }
            msg = "Not a local binding";
        }
        throw new ChainedIllegalBindingException(null , weaveableC , sItf.getFcItfOwner() , clientItfName , sItf.getFcItfName() , msg);
    }
    
    /** 
     * Checks the interface name with the component's type and then calls the
     * {@link #bindFc(InterfaceType,String,Object) bindFc} method. If the server
     * interface implements {@link Interface}, and if its type is an instance of
     * {@link InterfaceType}, this method also checks the compatibility between
     * the client and server interface types.
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @param serverItf a server interface.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be created.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but it is not in an appropriate state
     *      to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.TypeBindingMixin#bindFc(java.lang.String,java.lang.Object)
     */
    public void bindFc(final String clientItfName, final Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        ComponentType compType = ((ComponentType)(weaveableC.getFcType()));
        InterfaceType cItfType;
        try {
            cItfType = compType.getFcInterfaceType(clientItfName);
        } catch (NoSuchInterfaceException e) {
            throw new ChainedNoSuchInterfaceException(null , weaveableC , clientItfName);
        }
        checkFcClientInterface(cItfType);
        ContentController cc;
        try {
            cc = ((ContentController)(weaveableC.getFcInterface("content-controller")));
        } catch (NoSuchInterfaceException e) {
            cc = null;
        }
        if (cItfType.isFcClientItf()) {
            weaveableC.getFcInterface(clientItfName);
        } else {
            cc.getFcInternalInterface(clientItfName);
        }
        Interface sItf;
        InterfaceType sItfType;
        try {
            sItf = ((Interface)(serverItf));
            sItfType = ((InterfaceType)(sItf.getFcItfType()));
        } catch (ClassCastException e) {
            bindFc(cItfType ,clientItfName ,serverItf);
            return ;
        }
        if (sItfType.isFcClientItf()) {
            throw new ChainedIllegalBindingException(null , weaveableC , sItf.getFcItfOwner() , clientItfName , sItf.getFcItfName() , "Cannot bind two client interfaces together");
        } 
        try {
            Class s = Class.forName(sItfType.getFcItfSignature());
            Class c = Class.forName(cItfType.getFcItfSignature());
            if (!(c.isAssignableFrom(s))) {
                throw new ChainedIllegalBindingException(null , weaveableC , sItf.getFcItfOwner() , clientItfName , sItf.getFcItfName() , ("The server interface type is not a subtype " + "of the client interface type"));
            } 
        } catch (ClassNotFoundException ignored) {
        }
        if ((!(cItfType.isFcOptionalItf())) && (sItfType.isFcOptionalItf())) {
            throw new ChainedIllegalBindingException(null , weaveableC , ((Interface)(serverItf)).getFcItfOwner() , clientItfName , ((Interface)(serverItf)).getFcItfName() , "A mandatory interface cannot be bound to an optional interface");
        } 
        bindFc(cItfType ,clientItfName ,sItf);
    }
    
    /** 
     * @see org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin#lookupFc(java.lang.String)
     */
    private Object lookupFc$1(final String clientItfName) throws NoSuchInterfaceException {
        if ((fcContent) == (this)) {
            ContentBindingController cbc = ((ContentBindingController)(this));
            return cbc.lookupFcContent(clientItfName);
        } else {
            BindingController bc = ((BindingController)(fcContent));
            return bc.lookupFc(clientItfName);
        }
    }
    
    /** 
     * The {@link BindingController#unbindFc unbindFc} method overriden by this
     * mixin.
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be removed.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      LifeCycleController} interface, but it is not in an appropriate state
     *      to perform this operation.
     */
    private void unbindFc$4(String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
    }
    
    /** 
     * @see org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin#bindFc(java.lang.String,java.lang.Object)
     */
    private void bindFc$2(final String clientItfName, final Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        if ((fcContent) == (this)) {
            ((ContentBindingController)(this)).bindFcContent(clientItfName ,serverItf);
        } else {
            ((BindingController)(fcContent)).bindFc(clientItfName ,serverItf);
        }
    }
    
    /** 
     * @see org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin#unbindFc(java.lang.String)
     */
    private void unbindFc$3(final String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        if ((fcContent) == (this)) {
            ((ContentBindingController)(this)).unbindFcContent(clientItfName);
        } else {
            ((BindingController)(fcContent)).unbindFc(clientItfName);
        }
    }
    
    /** 
     * Gets the interceptor of the given client interface, updates its {@link
     * Interceptor#getFcItfDelegate getFcItfDelegate}, and then calls the
     * overriden method (if there is an interceptor for the client interface).
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be removed.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but it is not in an appropriate state
     *      to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin#unbindFc(java.lang.String)
     */
    private void unbindFc$2(final String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        Object o = weaveableC.getFcInterface(clientItfName);
        if (o instanceof ComponentInterface) {
            Object next = ((ComponentInterface)(o)).getFcItfImpl();
            if (next instanceof Interceptor) {
                ((Interceptor)(next)).setFcItfDelegate(null);
            } else {
                ((ComponentInterface)(o)).setFcItfImpl(null);
            }
        } 
        unbindFc$3(clientItfName);
    }
    
    /** 
     * Checks the interface name with the component's type and then calls the
     * {@link #unbindFc(InterfaceType,String) unbindFc} method.
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be removed.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but it is not in an appropriate state
     *      to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.TypeBindingMixin#unbindFc(java.lang.String)
     */
    private void unbindFc$0(final String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        ComponentType compType = ((ComponentType)(weaveableC.getFcType()));
        InterfaceType clientItfType;
        try {
            clientItfType = compType.getFcInterfaceType(clientItfName);
        } catch (NoSuchInterfaceException e) {
            throw new ChainedNoSuchInterfaceException(null , weaveableC , clientItfName);
        }
        checkFcClientInterface(clientItfType);
        unbindFc(clientItfType ,clientItfName);
    }
    
    /** 
     * The {@link TypeBindingMixin#bindFc(InterfaceType,String,Object) bindFc}
     * method overriden by this mixin.
     *
     * @param clientItfType the type of the clientItfName interface.
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @param serverItf a server interface.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be created.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but
     *      it is not in an appropriate state to perform this operation.
     */
    private void bindFc$1(InterfaceType clientItfType, String clientItfName, Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
    }
    
    /** 
     * Returns the interface to which the given client interface is bound. More
     * precisely, returns the server interface to which the client interface whose
     * name is given is bound.
     *
     * @param clientItfType the type of the clientItfName interface.
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @return the server interface to which the given interface is bound, or 
     *      null if it is not bound.
     * @throws NoSuchInterfaceException if the component to which this interface
     *      belongs does not have a client interface whose name is equal to the
     *      given name.
     * @see org.objectweb.fractal.julia.control.binding.TypeBindingMixin#lookupFc(org.objectweb.fractal.api.type.InterfaceType,java.lang.String)
     */
    public Object lookupFc(final InterfaceType clientItfType, final String clientItfName) throws NoSuchInterfaceException {
        return lookupFc$0(clientItfName);
    }
    
    /** 
     * Binds the client interface whose name is given to a server interface. More
     * precisely, binds the client interface of the component to which this
     * interface belongs, and whose name is equal to the given name, to the given
     * server interface.
     *
     * @param clientItfType the type of the clientItfName interface.
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @param serverItf a server interface.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be created.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but
     *      it is not in an appropriate state to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.TypeBindingMixin#bindFc(org.objectweb.fractal.api.type.InterfaceType,java.lang.String,java.lang.Object)
     */
    private void bindFc$0(final InterfaceType clientItfType, final String clientItfName, final Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        bindFc$0(clientItfName ,serverItf);
    }
    
    /** 
     * Unbinds the given client interface. More precisely, unbinds the client
     * interface of the component to which this interface belongs, and whose name
     * is equal to the given name.
     *
     * @param clientItfType the type of the clientItfName interface.
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be removed.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but
     *      it is not in an appropriate state to perform this operation.
     * @see org.objectweb.fractal.julia.control.binding.TypeBindingMixin#unbindFc(org.objectweb.fractal.api.type.InterfaceType,java.lang.String)
     */
    public void unbindFc(final InterfaceType clientItfType, final String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
        unbindFc$1(clientItfName);
    }
    
    /** 
     * Checks that the given type corresponds to an external or internal client 
     * interface.
     *
     * @param itfType an interface type.
     * @throws NoSuchInterfaceException if the given type does not correspdond to
     *      an external or internal client interface.
     * @see org.objectweb.fractal.julia.control.binding.TypeBindingMixin#checkFcClientInterface(org.objectweb.fractal.api.type.InterfaceType)
     */
    private void checkFcClientInterface(InterfaceType itfType) throws NoSuchInterfaceException {
        try {
            weaveableC.getFcInterface("content-controller");
            String name = itfType.getFcItfName();
            if ((!(name.equals("component"))) && (!(name.endsWith("-controller")))) {
                return ;
            } 
        } catch (NoSuchInterfaceException e) {
            if (itfType.isFcClientItf()) {
                return ;
            } 
        }
        throw new ChainedNoSuchInterfaceException(null , weaveableC , itfType.getFcItfName());
    }
    
    /** 
     * The {@link BindingController#lookupFc lookupFc} method overriden by this
     * mixin.
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @return the server interface to which the given interface is bound, or 
     *      null if it is not bound.
     * @throws NoSuchInterfaceException if the component to which this interface
     *      belongs does not have a client interface whose name is equal to the
     *      given name.
     */
    private Object lookupFc$2(String clientItfName) throws NoSuchInterfaceException {
        return null;
    }
    
    /** 
     * The {@link BindingController#bindFc bindFc} method overriden by this
     * mixin.
     *
     * @param clientItfName the name of a client interface of the component to
     *      which this interface belongs.
     * @param serverItf a server interface.
     * @throws NoSuchInterfaceException if there is no such client interface.
     * @throws IllegalBindingException if the binding cannot be created.
     * @throws IllegalLifeCycleException if this component has a {@link
     *      org.objectweb.fractal.api.control.LifeCycleController} interface, but it is not in an appropriate state
     *      to perform this operation.
     */
    private void bindFc$3(String clientItfName, Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException {
    }
    
    public String getFcGeneratorParameters() {
        return "(org.objectweb.fractal.juliac.spoon.MixinClassGenerator juliac.generated.ContainerBindingControllerImpl org.objectweb.fractal.julia.BasicControllerMixin org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin org.objectweb.fractal.julia.UseComponentMixin org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin org.objectweb.fractal.julia.control.binding.CheckBindingMixin org.objectweb.fractal.julia.control.binding.TypeBindingMixin org.objectweb.fractal.julia.control.content.UseSuperControllerMixin org.objectweb.fractal.julia.control.binding.ContentBindingMixin org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin)";
    }
    
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy