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

org.objectweb.fractal.koch.membrane.ParametricCompositeTemplate Maven / Gradle / Ivy

The newest version!
/*
 * Generated by org.objectweb.fractal.koch.mc.MembraneCompiler on: Sat Dec 29 18:02:38 CET 2007
 */
package org.objectweb.fractal.koch.membrane;

import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.type.ComponentType;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.util.Fractal;
import org.objectweb.fractal.api.NoSuchInterfaceException;

/**
 * Implementation of the ParametricCompositeTemplate membrane factory component.
 *
 * @author Lionel Seinturier 
 * @since 2.5
 */
public class ParametricCompositeTemplate implements org.objectweb.fractal.api.factory.Factory, org.objectweb.fractal.api.control.BindingController {

  public Object getFcContentDesc() {
    throw new java.lang.UnsupportedOperationException();
  }

  public Object getFcControllerDesc() {
    throw new java.lang.UnsupportedOperationException();
  }

  public Component newFcInstance() throws org.objectweb.fractal.api.factory.InstantiationException {
    try {
      // --------------------------------------------------
InterfaceType IT0 = typeFactory.createFcItfType("//component", "org.objectweb.fractal.api.Component", false, false, false);
ComponentType CT0 = typeFactory.createFcType(new InterfaceType [] { IT0 });
Component C0 = genericFactory.newFcInstance(CT0, "mPrimitive", "'component-impl");
try { Fractal.getNameController(C0).setFcName("Comp"); } catch (NoSuchInterfaceException ignored) { }
Fractal.getLifeCycleController(C0).startFc();
InterfaceType IT1 = typeFactory.createFcItfType("//component", "org.objectweb.fractal.api.Component", true, false, false);
InterfaceType IT2 = typeFactory.createFcItfType("///cloneable-attribute-controller", "org.objectweb.fractal.julia.control.attribute.CloneableAttributeController", false, false, false);
ComponentType CT1 = typeFactory.createFcType(new InterfaceType [] { IT1, IT2 });
Component C1 = genericFactory.newFcInstance(CT1, "mPrimitive", "((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator ('attributeControllerInterface)))");
try { Fractal.getNameController(C1).setFcName("AC"); } catch (NoSuchInterfaceException ignored) { }
InterfaceType IT3 = typeFactory.createFcItfType("//name-controller", "org.objectweb.fractal.api.control.NameController", false, false, false);
ComponentType CT2 = typeFactory.createFcType(new InterfaceType [] { IT3 });
Component C2 = genericFactory.newFcInstance(CT2, "mPrimitive", "'name-controller-impl");
try { Fractal.getNameController(C2).setFcName("NC"); } catch (NoSuchInterfaceException ignored) { }
Fractal.getLifeCycleController(C2).startFc();
InterfaceType IT4 = typeFactory.createFcItfType("//super-controller", "org.objectweb.fractal.julia.control.content.SuperControllerNotifier", true, false, false);
InterfaceType IT5 = typeFactory.createFcItfType("//component", "org.objectweb.fractal.api.Component", true, false, false);
InterfaceType IT6 = typeFactory.createFcItfType("//binding-controller", "org.objectweb.fractal.api.control.BindingController", false, false, false);
ComponentType CT3 = typeFactory.createFcType(new InterfaceType [] { IT4, IT5, IT6 });
Component C3 = genericFactory.newFcInstance(CT3, "mPrimitive", "'primitive-binding-controller-impl");
try { Fractal.getNameController(C3).setFcName("BC"); } catch (NoSuchInterfaceException ignored) { }
InterfaceType IT7 = typeFactory.createFcItfType("//super-controller", "org.objectweb.fractal.julia.control.content.SuperControllerNotifier", false, false, false);
ComponentType CT4 = typeFactory.createFcType(new InterfaceType [] { IT7 });
Component C4 = genericFactory.newFcInstance(CT4, "mPrimitive", "'super-controller-impl");
try { Fractal.getNameController(C4).setFcName("SC"); } catch (NoSuchInterfaceException ignored) { }
Fractal.getLifeCycleController(C4).startFc();
InterfaceType IT8 = typeFactory.createFcItfType("//component", "org.objectweb.fractal.api.Component", true, false, false);
InterfaceType IT9 = typeFactory.createFcItfType("//content-controller", "org.objectweb.fractal.api.control.ContentController", false, false, false);
ComponentType CT5 = typeFactory.createFcType(new InterfaceType [] { IT8, IT9 });
Component C5 = genericFactory.newFcInstance(CT5, "mPrimitive", "'content-controller-impl");
try { Fractal.getNameController(C5).setFcName("CC"); } catch (NoSuchInterfaceException ignored) { }
InterfaceType IT10 = typeFactory.createFcItfType("///cloneable-attribute-controller", "org.objectweb.fractal.julia.control.attribute.CloneableAttributeController", true, true, false);
InterfaceType IT11 = typeFactory.createFcItfType("//name-controller", "org.objectweb.fractal.api.control.NameController", true, false, false);
InterfaceType IT12 = typeFactory.createFcItfType("//component", "org.objectweb.fractal.api.Component", true, false, false);
InterfaceType IT13 = typeFactory.createFcItfType("//factory", "org.objectweb.fractal.julia.factory.Template", false, false, false);
InterfaceType IT14 = typeFactory.createFcItfType("///template", "org.objectweb.fractal.julia.factory.Template", false, false, false);
ComponentType CT6 = typeFactory.createFcType(new InterfaceType [] { IT10, IT11, IT12, IT13, IT14 });
Component C6 = genericFactory.newFcInstance(CT6, "mPrimitive", "'factory-impl");
try { Fractal.getNameController(C6).setFcName("FC"); } catch (NoSuchInterfaceException ignored) { }
InterfaceType IT15 = typeFactory.createFcItfType("///membrane-controller", "org.objectweb.fractal.koch.control.membrane.MembraneController", false, false, false);
ComponentType CT7 = typeFactory.createFcType(new InterfaceType [] { IT15 });
Component C7 = genericFactory.newFcInstance(CT7, "mPrimitive", "'membrane-controller-impl");
try { Fractal.getNameController(C7).setFcName("MC"); } catch (NoSuchInterfaceException ignored) { }
Fractal.getLifeCycleController(C7).startFc();
InterfaceType IT16 = typeFactory.createFcItfType("//content-controller", "org.objectweb.fractal.api.control.ContentController", false, false, false);
InterfaceType IT17 = typeFactory.createFcItfType("//super-controller", "org.objectweb.fractal.julia.control.content.SuperControllerNotifier", false, false, false);
InterfaceType IT18 = typeFactory.createFcItfType("//name-controller", "org.objectweb.fractal.api.control.NameController", false, false, false);
InterfaceType IT19 = typeFactory.createFcItfType("//component", "org.objectweb.fractal.api.Component", false, false, false);
InterfaceType IT20 = typeFactory.createFcItfType("//binding-controller", "org.objectweb.fractal.api.control.BindingController", false, false, false);
InterfaceType IT21 = typeFactory.createFcItfType("//factory", "org.objectweb.fractal.julia.factory.Template", false, false, false);
InterfaceType IT22 = typeFactory.createFcItfType("///template", "org.objectweb.fractal.julia.factory.Template", false, false, false);
InterfaceType IT23 = typeFactory.createFcItfType("///cloneable-attribute-controller", "org.objectweb.fractal.julia.control.attribute.CloneableAttributeController", false, false, false);
InterfaceType IT24 = typeFactory.createFcItfType("///membrane-controller", "org.objectweb.fractal.koch.control.membrane.MembraneController", false, false, false);
ComponentType CT8 = typeFactory.createFcType(new InterfaceType [] { IT16, IT17, IT18, IT19, IT20, IT21, IT22, IT23, IT24 });
Component C8 = genericFactory.newFcInstance(CT8, "mComposite", null);
try { Fractal.getNameController(C8).setFcName("org.objectweb.fractal.koch.membrane.ParametricCompositeTemplate"); } catch (NoSuchInterfaceException ignored) { }
Fractal.getContentController(C8).addFcSubComponent(C0);
Fractal.getContentController(C8).addFcSubComponent(C1);
Fractal.getContentController(C8).addFcSubComponent(C2);
Fractal.getContentController(C8).addFcSubComponent(C3);
Fractal.getContentController(C8).addFcSubComponent(C4);
Fractal.getContentController(C8).addFcSubComponent(C5);
Fractal.getContentController(C8).addFcSubComponent(C6);
Fractal.getContentController(C8).addFcSubComponent(C7);
Fractal.getBindingController(C8).bindFc("//component", C0.getFcInterface("//component"));
Fractal.getBindingController(C8).bindFc("///cloneable-attribute-controller", C1.getFcInterface("///cloneable-attribute-controller"));
Fractal.getBindingController(C8).bindFc("//name-controller", C2.getFcInterface("//name-controller"));
Fractal.getBindingController(C8).bindFc("//binding-controller", C3.getFcInterface("//binding-controller"));
Fractal.getBindingController(C8).bindFc("//super-controller", C4.getFcInterface("//super-controller"));
Fractal.getBindingController(C8).bindFc("//content-controller", C5.getFcInterface("//content-controller"));
Fractal.getBindingController(C8).bindFc("//factory", C6.getFcInterface("//factory"));
Fractal.getBindingController(C8).bindFc("///template", C6.getFcInterface("///template"));
Fractal.getBindingController(C1).bindFc("//component", C0.getFcInterface("//component"));
Fractal.getBindingController(C3).bindFc("//component", C0.getFcInterface("//component"));
Fractal.getBindingController(C3).bindFc("//super-controller", C4.getFcInterface("//super-controller"));
Fractal.getBindingController(C5).bindFc("//component", C0.getFcInterface("//component"));
Fractal.getBindingController(C6).bindFc("//component", C0.getFcInterface("//component"));
Fractal.getBindingController(C6).bindFc("//name-controller", C2.getFcInterface("//name-controller"));
Fractal.getBindingController(C6).bindFc("///cloneable-attribute-controller", C1.getFcInterface("///cloneable-attribute-controller"));
Fractal.getBindingController(C8).bindFc("///membrane-controller", C7.getFcInterface("///membrane-controller"));
Fractal.getLifeCycleController(C1).startFc();
Fractal.getLifeCycleController(C3).startFc();
Fractal.getLifeCycleController(C5).startFc();
Fractal.getLifeCycleController(C6).startFc();
Fractal.getLifeCycleController(C8).startFc();
      // --------------------------------------------------
      return C8;
    }
    catch( Exception e ) {
      e.printStackTrace();
      throw new org.objectweb.fractal.api.factory.InstantiationException(e.getMessage());
    }
  }

  public org.objectweb.fractal.api.Type getFcInstanceType() {
    try {
      // --------------------------------------------------
InterfaceType IT25 = typeFactory.createFcItfType("//content-controller", "org.objectweb.fractal.api.control.ContentController", false, false, false);
InterfaceType IT26 = typeFactory.createFcItfType("//super-controller", "org.objectweb.fractal.julia.control.content.SuperControllerNotifier", false, false, false);
InterfaceType IT27 = typeFactory.createFcItfType("//name-controller", "org.objectweb.fractal.api.control.NameController", false, false, false);
InterfaceType IT28 = typeFactory.createFcItfType("//component", "org.objectweb.fractal.api.Component", false, false, false);
InterfaceType IT29 = typeFactory.createFcItfType("//binding-controller", "org.objectweb.fractal.api.control.BindingController", false, false, false);
InterfaceType IT30 = typeFactory.createFcItfType("//factory", "org.objectweb.fractal.julia.factory.Template", false, false, false);
InterfaceType IT31 = typeFactory.createFcItfType("///template", "org.objectweb.fractal.julia.factory.Template", false, false, false);
InterfaceType IT32 = typeFactory.createFcItfType("///cloneable-attribute-controller", "org.objectweb.fractal.julia.control.attribute.CloneableAttributeController", false, false, false);
InterfaceType IT33 = typeFactory.createFcItfType("///membrane-controller", "org.objectweb.fractal.koch.control.membrane.MembraneController", false, false, false);
ComponentType CT9 = typeFactory.createFcType(new InterfaceType [] { IT25, IT26, IT27, IT28, IT29, IT30, IT31, IT32, IT33 });
      // --------------------------------------------------
      return CT9;
    }
    catch( Exception e ) {
      e.printStackTrace();
      throw new RuntimeException(e.getMessage());
    }
  }

  private org.objectweb.fractal.api.type.TypeFactory typeFactory;
  private org.objectweb.fractal.api.factory.GenericFactory genericFactory;

  public String[] listFc() {
    return new String[]{"type-factory","generic-factory"};
  }

  public void bindFc( String clientItfName, Object serverItf ) {
    if( clientItfName.equals("type-factory") ) {
      typeFactory = (org.objectweb.fractal.api.type.TypeFactory) serverItf;
    }
    if( clientItfName.equals("generic-factory") ) {
      genericFactory = (org.objectweb.fractal.api.factory.GenericFactory) serverItf;
    }
  }

  public Object lookupFc( String clientItfName ) {
    if( clientItfName.equals("type-factory") ) {
      return typeFactory;
    }
    if( clientItfName.equals("generic-factory") ) {
      return genericFactory;
    }
    return null;
  }

  public void unbindFc( String clientItfName ) {
    if( clientItfName.equals("type-factory") ) {
      typeFactory = null;
    }
    if( clientItfName.equals("generic-factory") ) {
      genericFactory = null;
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy