Package org.omg.CosTransactions

Examples of org.omg.CosTransactions.Resource


            sync.before_completion();
        }

        if (resources.size() == 1){

            Resource r = (Resource)resources.elementAt(0);
            try {
                r.commit_one_phase();
      } catch(org.omg.CORBA.TRANSACTION_ROLLEDBACK tr) {
              // the only one resource requested a rollback
        votes.setElementAt(Vote.VoteRollback,0);
        rollback();
        throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK();
            } catch(HeuristicHazard hh) {
                throw new org.omg.CORBA.NO_IMPLEMENT();
            }
      votes.setElementAt(Vote.VoteCommit,0);

            if (!move_to_state(Status._StatusPrepared)){
                throw new org.omg.CORBA.INTERNAL();
            }
            if (!move_to_state(Status._StatusCommitting)){
                throw new org.omg.CORBA.INTERNAL();
            }
        } else {
            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                try {
                    Vote v = r.prepare();
                    votes.setElementAt(v, i);
                    if (v.value() == Vote._VoteRollback){

                        rollback();
                        throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK();

                    }
                } catch(HeuristicHazard hh) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                } catch(HeuristicMixed hm) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                }
            }

            if (!move_to_state(Status._StatusPrepared)){
                throw new org.omg.CORBA.INTERNAL();
            }
            if (!move_to_state(Status._StatusCommitting)){
                throw new org.omg.CORBA.INTERNAL();
            }

            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                Vote     v = (Vote)votes.elementAt(i);
               
                try {
                    if (v == null){
                        throw new org.omg.CORBA.INTERNAL();
                    } else {
                        if (v.value() == Vote._VoteCommit){
                            r.commit();
                        }
                    }
                } catch(NotPrepared np) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                } catch(HeuristicRollback hr) {
View Full Code Here


        destroy();
    }

    private void rolling_to_back(){
        for (int i = 0;i < resources.size();i++){
            Resource r = (Resource)resources.elementAt(i);
            Vote     v = (Vote)votes.elementAt(i);
            try {
                if (v == null){
                    r.rollback();
                } else {
                    if (v.value() == Vote._VoteCommit){
                        r.rollback();
                    }
                }
            } catch(HeuristicCommit hc) {
                throw new org.omg.CORBA.NO_IMPLEMENT();
            } catch(HeuristicMixed hm) {
View Full Code Here

        }

        TransactionCoordinator coordinator = new TransactionCoordinator( this, current, poa );
        try
        {
            Resource res = ResourceHelper.narrow( poa.servant_to_reference( coordinator ) );
            current.register_resource( res );
        }
        catch ( Exception e )
        {
            e.printStackTrace( System.out );
View Full Code Here

            Coordinator coordinator = control.get_coordinator();

            DemoResource resource = new DemoResource();

            oa.objectIsReady(resource);
            Resource res = ResourceHelper.narrow(oa.corbaReference(resource));

            coordinator.register_resource(res);
        }
        catch (Exception e)
        {
View Full Code Here

            sync.before_completion();
        }

        if (resources.size() == 1){

            Resource r = (Resource)resources.elementAt(0);
            try {
                r.commit_one_phase();
      } catch(org.omg.CORBA.TRANSACTION_ROLLEDBACK tr) {
              // the only one resource requested a rollback
        votes.setElementAt(Vote.VoteRollback,0);
        rollback();
        throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK();
            } catch(HeuristicHazard hh) {
                throw new org.omg.CORBA.NO_IMPLEMENT();
            }
      votes.setElementAt(Vote.VoteCommit,0);

            if (!move_to_state(Status._StatusPrepared)){
                throw new org.omg.CORBA.INTERNAL();
            }
            if (!move_to_state(Status._StatusCommitting)){
                throw new org.omg.CORBA.INTERNAL();
            }
        } else {
            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                try {
                    Vote v = r.prepare();
                    votes.setElementAt(v, i);
                    if (v.value() == Vote._VoteRollback){

                        rollback();
                        throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK();

                    }
                } catch(HeuristicHazard hh) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                } catch(HeuristicMixed hm) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                }
            }

            if (!move_to_state(Status._StatusPrepared)){
                throw new org.omg.CORBA.INTERNAL();
            }
            if (!move_to_state(Status._StatusCommitting)){
                throw new org.omg.CORBA.INTERNAL();
            }

            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                Vote     v = (Vote)votes.elementAt(i);
               
                try {
                    if (v == null){
                        throw new org.omg.CORBA.INTERNAL();
                    } else {
                        if (v.value() == Vote._VoteCommit){
                            r.commit();
                        }
                    }
                } catch(NotPrepared np) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                } catch(HeuristicRollback hr) {
View Full Code Here

        destroy();
    }

    private void rolling_to_back(){
        for (int i = 0;i < resources.size();i++){
            Resource r = (Resource)resources.elementAt(i);
            Vote     v = (Vote)votes.elementAt(i);
            try {
                if (v == null){
                    r.rollback();
                } else {
                    if (v.value() == Vote._VoteCommit){
                        r.rollback();
                    }
                }
            } catch(HeuristicCommit hc) {
                throw new org.omg.CORBA.NO_IMPLEMENT();
            } catch(HeuristicMixed hm) {
View Full Code Here

/*  68 */       StatusHelper.write(_out, get_top_level_status());
/*  69 */       break;
/*     */     case 1:
/*     */       try
/*     */       {
/*  75 */         Resource _arg0 = ResourceHelper.read(_input);
/*  76 */         _out = handler.createReply();
/*  77 */         RecoveryCoordinatorHelper.write(_out, register_resource(_arg0));
/*     */       }
/*     */       catch (Inactive _ex0)
/*     */       {
/*  81 */         _out = handler.createExceptionReply();
/*  82 */         InactiveHelper.write(_out, _ex0);
/*     */       }
/*     */
/*     */     case 2:
/*     */       try
/*     */       {
/*  90 */         Resource _arg0 = ResourceHelper.read(_input);
/*  91 */         _out = handler.createReply();
/*  92 */         StatusHelper.write(_out, replay_completion(_arg0));
/*     */       }
/*     */       catch (NotPrepared _ex0)
/*     */       {
View Full Code Here

/*  60 */       StatusHelper.write(_out, get_top_level_status());
/*  61 */       break;
/*     */     case 1:
/*     */       try
/*     */       {
/*  67 */         Resource _arg0 = ResourceHelper.read(_input);
/*  68 */         _out = handler.createReply();
/*  69 */         RecoveryCoordinatorHelper.write(_out, register_resource(_arg0));
/*     */       }
/*     */       catch (Inactive _ex0)
/*     */       {
View Full Code Here

            sync.before_completion();
        }

        if (resources.size() == 1){

            Resource r = (Resource)resources.elementAt(0);
            try {
                r.commit_one_phase();
      } catch(org.omg.CORBA.TRANSACTION_ROLLEDBACK tr) {
              // the only one resource requested a rollback
        votes.setElementAt(Vote.VoteRollback,0);
        rollback();
        throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK();
            } catch(HeuristicHazard hh) {
                throw new org.omg.CORBA.NO_IMPLEMENT();
            }
      votes.setElementAt(Vote.VoteCommit,0);

            if (!move_to_state(Status._StatusPrepared)){
                throw new org.omg.CORBA.INTERNAL();
            }
            if (!move_to_state(Status._StatusCommitting)){
                throw new org.omg.CORBA.INTERNAL();
            }
        } else {
            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                try {
                    Vote v = r.prepare();
                    votes.setElementAt(v, i);
                    if (v.value() == Vote._VoteRollback){

                        rollback();
                        throw new org.omg.CORBA.TRANSACTION_ROLLEDBACK();

                    }
                } catch(HeuristicHazard hh) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                } catch(HeuristicMixed hm) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                }
            }

            if (!move_to_state(Status._StatusPrepared)){
                throw new org.omg.CORBA.INTERNAL();
            }
            if (!move_to_state(Status._StatusCommitting)){
                throw new org.omg.CORBA.INTERNAL();
            }

            for (int i = 0;i < resources.size();i++){
                Resource r = (Resource)resources.elementAt(i);
                Vote     v = (Vote)votes.elementAt(i);
               
                try {
                    if (v == null){
                        throw new org.omg.CORBA.INTERNAL();
                    } else {
                        if (v.value() == Vote._VoteCommit){
                            r.commit();
                        }
                    }
                } catch(NotPrepared np) {
                    throw new org.omg.CORBA.NO_IMPLEMENT();
                } catch(HeuristicRollback hr) {
View Full Code Here

        destroy();
    }

    private void rolling_to_back(){
        for (int i = 0;i < resources.size();i++){
            Resource r = (Resource)resources.elementAt(i);
            Vote     v = (Vote)votes.elementAt(i);
            try {
                if (v == null){
                    r.rollback();
                } else {
                    if (v.value() == Vote._VoteCommit){
                        r.rollback();
                    }
                }
            } catch(HeuristicCommit hc) {
                throw new org.omg.CORBA.NO_IMPLEMENT();
            } catch(HeuristicMixed hm) {
View Full Code Here

TOP

Related Classes of org.omg.CosTransactions.Resource

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.