Package org.objectweb.fractal.api.control

Examples of org.objectweb.fractal.api.control.BindingController


      //optimistic or dblocking
      logger.log(BasicLevel.INFO, sb.toString());

        ContentController tpmCC = Fractal.getContentController(composite_tpm);
    //fetch the primitive concurrency manager
    BindingController tpmBC = Fractal.getBindingController(
        getSubComponent(composite_tpm, "transactional-persistence-manager"));
    tpmBC.unbindFc("concurrency-manager");

    //Remove the old pessimistic concurrency manager
    BindingController cmBC = Fractal.getBindingController(cm);
        String[] bds = cmBC.listFc();
        for (int i = 0; i < bds.length; i++) {
            cmBC.unbindFc(bds[i]);
        }
    tpmCC.removeFcSubComponent(cm);


    //instanciate the new ConcurrencyManager
    cm = (Component)getADLFactory().newComponent(tempName, null);
    //Add the new concurrency manager into the composite
    tpmCC.addFcSubComponent(cm);
    //bind the server interface of the new concurrency manager
    cmBC = Fractal.getBindingController(cm);
    if (dbLocking) {
            cmBC.bindFc(PConcurrencyManager.STATE_MANAGER_BINDING,
                    tpmCC.getFcInternalInterface("state-manager"));
            cmBC.bindFc(PConcurrencyManager.STORAGE_MANAGER_BINDING,
                    tpmCC.getFcInternalInterface("storage-manager"));
        } else {//optimistic
      cmBC.bindFc(PConcurrencyManager.DEPENDENCY_GRAPH_BINDING,
        getSubComponent(composite_tpm, "dependency-graph")
        .getFcInterface("dependency-graph"));
    }

    //bind the client interface of the new ConcurrencyManager
View Full Code Here


    try {
      //instanciate the POManagerItf
      Component pmC = Fractal.getFactory(pmT).newFcInstance();
      POManagerItf pm = (POManagerItf) pmC.getFcInterface("po-manager");
      Fractal.getNameController(pmC).setFcName("po-manager");
      BindingController pmBC = Fractal.getBindingController(pmC);

      //instanciate the JDOTransactionItf
      Component tC = Fractal.getFactory(tT).newFcInstance();
      Fractal.getNameController(tC).setFcName("transaction");
      TransactionItf t = (TransactionItf) tC.getFcInterface("transaction");
      BindingController tBC = Fractal.getBindingController(tC);

      //Add the new components into the Speedo composite
      Fractal.getContentController(speedoComponent).addFcSubComponent(pmC);
      Fractal.getContentController(speedoComponent).addFcSubComponent(tC);

      //add bindings on the po manager
      pmBC.bindFc(JDOPOManager.JORM_FACTORY_BINDING,
        components[JF_COMPONENT_IDX]);
      pmBC.bindFc(JDOPOManager.PNAME_CODER_BINDING,
        components[PNC_COMPONENT_IDX]);
      pmBC.bindFc(JDOPOManager.PO_MANAGER_FACTORY_BINDING,
        components[PMF_COMPONENT_IDX]);
      pmBC.bindFc(JDOPOManager.QUERY_MANAGER_BINDING,
        components[QM_COMPONENT_IDX]);
      pmBC.bindFc(JDOPOManager.TRANSACTIONAL_PERSISTENCE_MANAGER_BINDING,
        components[TPM_COMPONENT_IDX]);
      pmBC.bindFc(JDOPOManager.TRANSACTION_BINDING, t);

      //add bindings on the transaction
      tBC.bindFc(AbstractTransaction.PO_MANAGER_BINDING, pm);
      tBC.bindFc(AbstractTransaction.TRANSACTIONAL_PERSISTENCE_MANAGER_BINDING,
        components[TPM_COMPONENT_IDX]);
      tBC.bindFc(AbstractTransaction.MAPPER_BINDING,
        components[MAPPER_COMPONENT_IDX]);

      //Add a ConenctionHolder to the transaction
      t.setConnectionHolder(chf.createConnectionHolder());
View Full Code Here

   */
  public void destroyResource(Object resource) {
    try {
      //fetch the PM component
      Component pmC = ((Interface) resource).getFcItfOwner();
      BindingController pmBC = Fractal.getBindingController(pmC);

      //fetch the Tx component
      Component tC = ((Interface)
        pmBC.lookupFc(AbstractPOManager.TRANSACTION_BINDING))
        .getFcItfOwner();
      BindingController tBC = Fractal.getBindingController(tC);

      //Stop compoenents
      Fractal.getLifeCycleController(pmC).stopFc();
      Fractal.getLifeCycleController(tC).stopFc();

      //remove bindings of the PM component
      pmBC.unbindFc(AbstractPOManager.JORM_FACTORY_BINDING);
      pmBC.unbindFc(AbstractPOManager.PNAME_CODER_BINDING);
      pmBC.unbindFc(AbstractPOManager.PO_MANAGER_FACTORY_BINDING);
      pmBC.unbindFc(AbstractPOManager.QUERY_MANAGER_BINDING);
      pmBC.unbindFc(AbstractPOManager.TRANSACTIONAL_PERSISTENCE_MANAGER_BINDING);
      pmBC.unbindFc(AbstractPOManager.TRANSACTION_BINDING);

      //remove bindings of the Tx component
      tBC.unbindFc(AbstractTransaction.PO_MANAGER_BINDING);
      tBC.unbindFc(AbstractTransaction.TRANSACTIONAL_PERSISTENCE_MANAGER_BINDING);
      tBC.unbindFc(AbstractTransaction.MAPPER_BINDING);

      //remove both components from the composite
      //TODO: find a way to remove sub components without stopping Speedo !!!
      //Fractal.getContentController(speedoComponent).removeFcSubComponent(pmC);
      //Fractal.getContentController(speedoComponent).removeFcSubComponent(tC);
View Full Code Here

TOP

Related Classes of org.objectweb.fractal.api.control.BindingController

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.