コード例 #1
0
ファイル: Test.java プロジェクト: fviale/programming
 private Component wrapWithSynchronousCompositeOfTypeB(int index, Component wrappee)
     throws Exception {
   Component wrapper = Setup.createSynchronousCompositeOfTypeB("sync_composite_b" + index);
   GCM.getContentController(wrapper).addFcSubComponent(wrappee);
   GCM.getBindingController(wrapper).bindFc("i2", wrappee.getFcInterface("i2"));
   return wrapper;
 }
コード例 #2
0
ファイル: Test.java プロジェクト: fviale/programming
 private Component wrapWithCompositeOfTypeA(int index, Component wrappee) throws Exception {
   Component wrapper = Setup.createCompositeOfTypeA("composite_a" + index);
   GCM.getContentController(wrapper).addFcSubComponent(wrappee);
   GCM.getBindingController(wrapper).bindFc("i1", wrappee.getFcInterface("i1"));
   GCM.getBindingController(wrappee).bindFc("i2", wrapper.getFcInterface("i2"));
   return wrapper;
 }
コード例 #3
0
ファイル: Test.java プロジェクト: fviale/programming
  private void initializeComponentSystems() throws Exception {
    // system without wrapped components
    Component unwrappedA = Setup.createPrimitiveA();
    Component unwrappedB = Setup.createPrimitiveB1();
    GCM.getBindingController(unwrappedA).bindFc("i2", unwrappedB.getFcInterface("i2"));
    GCM.getGCMLifeCycleController(unwrappedA).startFc();
    GCM.getGCMLifeCycleController(unwrappedB).startFc();
    systemWithoutWrapping = unwrappedA;

    // system with wrapping but without shortcuts
    Component wrappedAWithoutShortcuts = Setup.createPrimitiveA();
    for (int i = 0; i < NB_WRAPPERS; i++) {
      wrappedAWithoutShortcuts =
          wrapWithCompositeOfTypeA(NB_WRAPPERS - i, wrappedAWithoutShortcuts);
    }

    Component wrappedBWithoutShortcuts = Setup.createPrimitiveB1();
    for (int i = 0; i < NB_WRAPPERS; i++) {
      wrappedBWithoutShortcuts =
          wrapWithCompositeOfTypeB(NB_WRAPPERS - i, wrappedBWithoutShortcuts);
    }

    GCM.getBindingController(wrappedAWithoutShortcuts)
        .bindFc("i2", wrappedBWithoutShortcuts.getFcInterface("i2"));
    GCM.getGCMLifeCycleController(wrappedAWithoutShortcuts).startFc();
    GCM.getGCMLifeCycleController(wrappedBWithoutShortcuts).startFc();

    systemWithWrappingWithoutShortcuts = wrappedAWithoutShortcuts;

    // system with wrapping and with shortcuts
    Component wrappedAWithShortcuts = Setup.createPrimitiveA();
    for (int i = 0; i < NB_WRAPPERS; i++) {
      wrappedAWithShortcuts =
          wrapWithSynchronousCompositeOfTypeA(NB_WRAPPERS - i, wrappedAWithShortcuts);
    }

    Component wrappedBWithShortcuts = Setup.createPrimitiveB1();
    for (int i = 0; i < NB_WRAPPERS; i++) {
      wrappedBWithShortcuts =
          wrapWithSynchronousCompositeOfTypeB(NB_WRAPPERS - i, wrappedBWithShortcuts);
    }

    GCM.getBindingController(wrappedAWithShortcuts)
        .bindFc("i2", wrappedBWithShortcuts.getFcInterface("i2"));
    GCM.getGCMLifeCycleController(wrappedAWithShortcuts).startFc();
    GCM.getGCMLifeCycleController(wrappedBWithShortcuts).startFc();

    systemWithWrappingWithShortcuts = wrappedAWithShortcuts;
  }