Package org.objectweb.fractal.api

Examples of org.objectweb.fractal.api.Component


  private Component getSubComponent(Component parent,
                    String path) throws Exception {
    //System.out.println("path: " + path);

    StringTokenizer st = new StringTokenizer(path, ".", false);
    Component res = parent;
    while(st.hasMoreTokens()) {
      String commponenentname = st.nextToken();
      Component[] children = Fractal.getContentController(res)
          .getFcSubComponents();
      int i = 0;
View Full Code Here


  public Component getSubComponent(Component parent,
      String path, String s) throws Exception {
    //System.out.println("path: " + path);
    StringTokenizer st = new StringTokenizer(path, ".", false);
    Component res = parent;
    while(st.hasMoreTokens()) {
      String commponenentname = st.nextToken();
      Component[] children = Fractal.getContentController(res)
      .getFcSubComponents();
      int i = 0;
View Full Code Here

    GCMVirtualNode VN1 = gcmad.getVirtualNode("VN1");
    GCMVirtualNode VN2 = gcmad.getVirtualNode("VN2");
    VN1.waitReady();
    VN2.waitReady();
   
    Component boot = Utils.getBootstrapComponent();
      PAGCMTypeFactory tf = Utils.getPAGCMTypeFactory(boot);
      PAGenericFactory gf = Utils.getPAGenericFactory(boot);
     
      ComponentType tTest = tf.createFcType(new InterfaceType[] {
          tf.createGCMItfType(
              "runnable",
              MSRunnable.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
        tf.createGCMItfType(
            "scc",
            SkandiumComponentController.class.getName(),
            GCMTypeFactory.SERVER,
            GCMTypeFactory.OPTIONAL,
            GCMTypeFactory.SINGLETON_CARDINALITY)
      });
     
      ComponentType tMergeSort = tf.createFcType(new InterfaceType[] {
          tf.createGCMItfType(
              "runnable",
              MSRunnable.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "sc",
              SkandiumComponent.class.getName(),
              GCMTypeFactory.CLIENT,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
        tf.createGCMItfType(
              "scrr",
              SCResultReceiver.class.getName(),
              GCMTypeFactory.SERVER,
            GCMTypeFactory.MANDATORY,
            GCMTypeFactory.SINGLETON_CARDINALITY)
      });
     
      ComponentType tSC = tf.createFcType(new InterfaceType[] {
          tf.createGCMItfType(
              "sc",
              SkandiumComponent.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "scrr",
              SCResultReceiver.class.getName(),
              GCMTypeFactory.CLIENT,
              GCMTypeFactory.OPTIONAL,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "sctS",
              SCTransmitter.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "sct",
              SCTransmitter.class.getName(),
              GCMTypeFactory.CLIENT,
              GCMTypeFactory.OPTIONAL,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "scrS",
              SCReceiver.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
        tf.createGCMItfType(
            "scr",
            SCReceiver.class.getName(),
            GCMTypeFactory.CLIENT,
            GCMTypeFactory.OPTIONAL,
            GCMTypeFactory.SINGLETON_CARDINALITY),
        tf.createGCMItfType(
            "scc",
            SkandiumComponentController.class.getName(),
            GCMTypeFactory.SERVER,
            GCMTypeFactory.OPTIONAL,
            GCMTypeFactory.SINGLETON_CARDINALITY)
      });
     
      Node N1A = VN1.getANode();
      Node N1B = VN1.getANode();
      Node N1C = VN1.getANode();
      Node N2 = VN2.getANode();
     
      Component testComponent = gf.newFcInstance(
          tTest,
          new ControllerDescription("testComponent", Constants.COMPOSITE),
          null,
          N1A);
     
      Component mergeSortComponent = gf.newFcInstance(
          tMergeSort,
          new ControllerDescription("mergeSortComponent", Constants.PRIMITIVE),
          new ContentDescription(MergeSort.class.getName()),
          N1B);
     
      Component SC1 = gf.newFcInstance(
          tSC,
          new ControllerDescription("SC1", Constants.PRIMITIVE),
          new ContentDescription(SkandiumComponentImp.class.getName()),
          N1C);
     
      Component SC2 = gf.newFcInstance(
          tSC,
          new ControllerDescription("SC2", Constants.PRIMITIVE),
          new ContentDescription(SkandiumComponentImp.class.getName()),
          N2);
     
      PAContentController cc = Utils.getPAContentController(testComponent);
      cc.addFcSubComponent(mergeSortComponent);
      cc.addFcSubComponent(SC1);
      cc.addFcSubComponent(SC2);
     
      PABindingController bcTest = Utils.getPABindingController(testComponent);
        bcTest.bindFc("runnable", mergeSortComponent.getFcInterface("runnable"));
        bcTest.bindFc("scc", SC1.getFcInterface("scc"));
       
        PABindingController bcMergeSort = Utils.getPABindingController(mergeSortComponent);
        bcMergeSort.bindFc("sc", SC1.getFcInterface("sc"));
       
        PABindingController bcSC1 = Utils.getPABindingController(SC1);
        bcSC1.bindFc("sct", SC2.getFcInterface("sctS"));
        bcSC1.bindFc("scrr", mergeSortComponent.getFcInterface("scrr"));

       
        PABindingController bcSC2 = Utils.getPABindingController(SC2);
        bcSC2.bindFc("scr", SC1.getFcInterface("scrS"));
       
        Utils.getPAGCMLifeCycleController(testComponent).startFc();

        SkandiumComponentController scc = (SkandiumComponentController)
            SC1.getFcInterface("scc");
        SkandiumComponentController scc2 = (SkandiumComponentController)
            SC2.getFcInterface("scc");
     
        DelegationCondition cond = new DelegationCondition() {

     
      private static final long serialVersionUID = 2L;
View Full Code Here

    GCMVirtualNode VN1 = gcmad.getVirtualNode("VN1");
    GCMVirtualNode VN2 = gcmad.getVirtualNode("VN2");
    VN1.waitReady();
    VN2.waitReady();
   
    Component boot = Utils.getBootstrapComponent();
      PAGCMTypeFactory tf = Utils.getPAGCMTypeFactory(boot);
      PAGenericFactory gf = Utils.getPAGenericFactory(boot);
     
      ComponentType tComposite = tf.createFcType(new InterfaceType[] {
          tf.createGCMItfType(
              "runnable",
              Runnable.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
        tf.createGCMItfType(
            "scc",
            SkandiumComponentController.class.getName(),
            GCMTypeFactory.SERVER,
            GCMTypeFactory.OPTIONAL,
            GCMTypeFactory.SINGLETON_CARDINALITY)
      });
     
      ComponentType tExample = tf.createFcType(new InterfaceType[] {
          tf.createGCMItfType(
              "runnable",
              Runnable.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "sc",
              SkandiumComponent.class.getName(),
              GCMTypeFactory.CLIENT,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
        tf.createGCMItfType(
              "scrr",
              SCResultReceiver.class.getName(),
              GCMTypeFactory.SERVER,
            GCMTypeFactory.MANDATORY,
            GCMTypeFactory.SINGLETON_CARDINALITY)
      });
     
      ComponentType tSC = tf.createFcType(new InterfaceType[] {
          tf.createGCMItfType(
              "sc",
              SkandiumComponent.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "scrr",
              SCResultReceiver.class.getName(),
              GCMTypeFactory.CLIENT,
              GCMTypeFactory.OPTIONAL,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "sctS",
              SCTransmitter.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "sct",
              SCTransmitter.class.getName(),
              GCMTypeFactory.CLIENT,
              GCMTypeFactory.OPTIONAL,
              GCMTypeFactory.SINGLETON_CARDINALITY),
          tf.createGCMItfType(
              "scrS",
              SCReceiver.class.getName(),
              GCMTypeFactory.SERVER,
              GCMTypeFactory.MANDATORY,
              GCMTypeFactory.SINGLETON_CARDINALITY),
        tf.createGCMItfType(
            "scr",
            SCReceiver.class.getName(),
            GCMTypeFactory.CLIENT,
            GCMTypeFactory.OPTIONAL,
            GCMTypeFactory.SINGLETON_CARDINALITY),
        tf.createGCMItfType(
            "scc",
            SkandiumComponentController.class.getName(),
            GCMTypeFactory.SERVER,
            GCMTypeFactory.OPTIONAL,
            GCMTypeFactory.SINGLETON_CARDINALITY)
      });
     
      Node N1composite = VN1.getANode();
      Node N1example = VN1.getANode();
      Node N1sc1 = VN1.getANode();
      Node N2sc2 = VN2.getANode();
     
      Component compositeComp = gf.newFcInstance(
          tComposite,
          new ControllerDescription("compositeComp", Constants.COMPOSITE),
          null,
          N1composite);
     
      Component exampleComp = gf.newFcInstance(
          tExample,
          new ControllerDescription("exampleComp", Constants.PRIMITIVE),
          new ContentDescription(NQueens.class.getName()),
          N1example);
     
      Component SC1 = gf.newFcInstance(
          tSC,
          new ControllerDescription("SC1", Constants.PRIMITIVE),
          new ContentDescription(SkandiumComponentImp.class.getName()),
          N1sc1);
     
      Component SC2 = gf.newFcInstance(
          tSC,
          new ControllerDescription("SC2", Constants.PRIMITIVE),
          new ContentDescription(SkandiumComponentImp.class.getName()),
          N2sc2);
     
      PAContentController cc = Utils.getPAContentController(compositeComp);
      cc.addFcSubComponent(exampleComp);
      cc.addFcSubComponent(SC1);
      cc.addFcSubComponent(SC2);
     
      PABindingController bcTest = Utils.getPABindingController(compositeComp);
        bcTest.bindFc("runnable", exampleComp.getFcInterface("runnable"));
        bcTest.bindFc("scc", SC1.getFcInterface("scc"));
       
        PABindingController bcMergeSort = Utils.getPABindingController(exampleComp);
        bcMergeSort.bindFc("sc", SC1.getFcInterface("sc"));
       
        PABindingController bcSC1 = Utils.getPABindingController(SC1);
        bcSC1.bindFc("sct", SC2.getFcInterface("sctS"));
        bcSC1.bindFc("scrr", exampleComp.getFcInterface("scrr"));

       
        PABindingController bcSC2 = Utils.getPABindingController(SC2);
        bcSC2.bindFc("scr", SC1.getFcInterface("scrS"));
       
        Utils.getPAGCMLifeCycleController(compositeComp).startFc();

        SkandiumComponentController scc = (SkandiumComponentController)
            SC1.getFcInterface("scc");
        SkandiumComponentController scc2 = (SkandiumComponentController)
            SC2.getFcInterface("scc");
     
        DelegationCondition cond = new DelegationCondition() {

     
      private static final long serialVersionUID = 2L;
View Full Code Here

TOP

Related Classes of org.objectweb.fractal.api.Component

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.