Package org.omg.CORBA

Examples of org.omg.CORBA.IntHolder


      int total = 0;
      for (int x = 0; x < matrixWidth; x++)
      {
        for (int y = 0; y < matrixHeight; y++)
        {
          IntHolder value = new IntHolder();

          matrix.get_value(x, y, value, null);

          correct = correct && ((value.value == 0) || (value.value == 1));
View Full Code Here


      int total = 0;
      for (int x = 0; x < matrixWidth; x++)
      {
        for (int y = 0; y < matrixHeight; y++)
        {
          IntHolder value = new IntHolder();

          matrix.get_value(x, y, value, null);

          total += value.value;
        }
View Full Code Here

      AtomicTransaction atomicTransaction = new AtomicTransaction();

      atomicTransaction.begin();

      IntHolder value = new IntHolder();
      counter.get(value, OTS.current().get_control());

      atomicTransaction.commit(true);

      if (value.value == (numberOfCalls / 2) && correct)
      {
        correct = true;
      }
      else
      {
        correct = false;
      }
    }
    catch (Exception exception)
    {
      correct = false;
      System.err.println("exception in first block" + exception);
      exception.printStackTrace(System.err);
    }

    System.err.println("Starting first shutdown");

    try
    {
      OAInterface.shutdownOA();
      ORBInterface.shutdownORB();
    }
    catch (Exception exception)
    {
      correct = false;
      System.err.println("exception in first shutdown" + exception);
      exception.printStackTrace(System.err);
    }

    System.err.println("----Starting second block -------");

    try
    {
      ORBInterface.initORB(args, null);
      OAInterface.initOA();
    }
    catch (Exception exception)
    {
      correct = false;
      System.err.println("exception in second start " + exception);
      exception.printStackTrace(System.err);
    }

    System.err.println("init done starting second block");

    try
    {
      String counterIOR = ServerIORStore.loadIOR(args[args.length - 1]);
      counter = CounterHelper.narrow(ORBInterface.orb().string_to_object(counterIOR));

      AtomicTransaction atomicTransaction = new AtomicTransaction();
      atomicTransaction.begin();
      counter.set(0, OTS.current().get_control());
      atomicTransaction.commit(true);
    }
    catch (Exception exception)
    {
      correct = false;
      System.err.println("exception in set operation " + exception);
      exception.printStackTrace(System.err);
    }

    try
    {
      for (int index = 0; index < numberOfCalls; index++)
      {
        AtomicTransaction atomicTransaction = new AtomicTransaction();

        atomicTransaction.begin();

        counter.increase(OTS.current().get_control());

        if ((index % 2) == 0)
        {
          atomicTransaction.commit(true);
        }
        else
        {
          atomicTransaction.rollback();
        }
      }

    }
    catch (Exception exception)
    {
      correct = false;
      System.err.println("exception in second loop block " + exception);
      exception.printStackTrace(System.err);
    }

    try
    {
      AtomicTransaction atomicTransaction = new AtomicTransaction();

      atomicTransaction.begin();

      IntHolder value = new IntHolder();
      counter.get(value, OTS.current().get_control());

      atomicTransaction.commit(true);

      if (value.value == (numberOfCalls / 2) && correct)
View Full Code Here

      AtomicTransaction atomicTransaction = new AtomicTransaction();

      atomicTransaction.begin();

      IntHolder value = new IntHolder();
      counter.get(value, OTS.current().get_control());

      atomicTransaction.commit(true);

      if (value.value == (numberOfCalls / 2))
View Full Code Here

      AtomicTransaction atomicTransaction = new AtomicTransaction();

      atomicTransaction.begin();

      IntHolder value = new IntHolder();

      counter.get(value);

      atomicTransaction.commit(true);
View Full Code Here

      Thread.sleep(Delays.recoveryDelay());

      boolean correct = true;

      IntHolder valueHolder = new IntHolder();
      service.get(valueHolder); // non-tx

      correct = correct && (valueHolder.value == 1);

      if (correct)
View Full Code Here

      Thread.sleep(Delays.recoveryDelay());

      boolean correct = true;

      IntHolder valueHolder = new IntHolder();
      service.get(valueHolder);

      //
      // recovery should have rolled the transaction back.
      // the set(1) change should therefore have been undone.
View Full Code Here

      Thread.sleep(Delays.recoveryDelay());

      boolean correct = true;

      IntHolder valueHolder = new IntHolder();
      service.get(valueHolder); // non-tx

      correct = correct && (valueHolder.value == 0);

      if (correct)
View Full Code Here

      Thread.sleep(Delays.recoveryDelay());

      boolean correct = true;

      IntHolder valueHolder = new IntHolder();
      service.get(valueHolder);

      //
      // recovery should have completed the transaction and
      // therefore dropped the locks on the value
View Full Code Here

      boolean correct = true;

      OTS.current().begin();

      IntHolder valueHolder = new IntHolder();
      service.get(OTS.current().get_control(), valueHolder);
      correct = correct && (valueHolder.value == 0);

      OTS.current().commit(true);
View Full Code Here

TOP

Related Classes of org.omg.CORBA.IntHolder

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.