Package com.arjuna.orbportability

Examples of com.arjuna.orbportability.ORB


        testProps.setProperty(PreInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb",ORB_INSTANCE_NAME_2),
                "com.hp.mwtests.orbportability.initialisation.preinit.PreInitialisation2");
        testProps.setProperty(PostInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb",ORB_INSTANCE_NAME_2),
                "com.hp.mwtests.orbportability.initialisation.postinit.PostInitialisation2");

        ORB orb = null;

        try
        {
            orb = ORB.getInstance(ORB_INSTANCE_NAME);
            logInformation("Initialising First ORB Instance");
            orb.initORB(args, testProps);
        }
        catch (Exception e)
        {
            logInformation("ERROR - "+e);
            assertFailure();
        }

        if (!PreInitialisation._called)
        {
            logInformation("FAILED: First ORB instance pre-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("First ORB instance pre-initialisation called");
        }

        if (!PostInitialisation._called)
        {
            logInformation("FAILED: First ORB instance post-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("First ORB instance post-initialisation called");
        }

        if (!PreInitialisation2._called)
        {
            logInformation("Second ORB instance pre-initialisation not called");
        }
        else
        {
            logInformation("FAILED: Second ORB instance pre-initialisation called");
            assertFailure();
        }

        if (!PostInitialisation2._called)
        {
            logInformation("Second ORB instance post-initialisation not called");
        }
        else
        {
            logInformation("FAILED: Second ORB instance post-initialisation called");
            assertFailure();
        }

        if (!AllPreInitialisation._called)
        {
            logInformation("FAILED: All ORB instances pre-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("All ORB instances pre-initialisation called");
        }

        if (!AllPostInitialisation._called)
        {
            logInformation("FAILED: All ORB instances post-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("All ORB instances post-initialisation called");
        }

        try
        {
            /**
             * Reset called flags on All ORB instance pre-initialisation
             */
            AllPreInitialisation._called = false;
            AllPostInitialisation._called = false;
            orb = ORB.getInstance(ORB_INSTANCE_NAME_2);
            logInformation("Initialising Second ORB Instance");
            orb.initORB(args, testProps);
        }
        catch (Exception e)
        {
            logInformation("ERROR - "+e);
            assertFailure();
        }

        if (!PreInitialisation2._called)
        {
            logInformation("FAILED: Second ORB instance pre-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("Second ORB instance pre-initialisation called");
        }

        if (!PostInitialisation2._called)
        {
            logInformation("FAILED: Second ORB instance post-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("Second ORB instance post-initialisation called");
        }

        if (!AllPreInitialisation._called)
        {
            logInformation("FAILED: All ORB instances pre-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("All ORB instances pre-initialisation called");
        }

        if (!AllPostInitialisation._called)
        {
            logInformation("FAILED: All ORB instances post-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("All ORB instances post-initialisation called");
        }

        try
        {
            orb.destroy();
        }
        catch (Exception e)
        {
            logInformation("ERROR - "+e);
            assertFailure();
View Full Code Here


            long myPoaExceptedValue = 0;

            for (int orbCount=0;orbCount<numberOfORBs;orbCount++)
            {
                String orbId = ORB_INSTANCE_NAME+orbCount;
                ORB orb = ORB.getInstance(orbId);
                logInformation("Initialising ORB Instance '"+orbId+"'");
                orb.initORB(args, null);
                RootOA rootOA = RootOA.getRootOA(orb);
                rootOA.initPOA(args);
                preInitExpectedValue++;

                if (PreInitialisation._count != preInitExpectedValue)
                {
                    logInformation("Checking: Failed, Pre-initialisation class not called as expected");
                    assertFailure();
                }
                else
                {
                    logInformation("Checking: Correct ("+preInitExpectedValue+")");
                }

                for (int oaCount=0;oaCount<numberOfOAsPerORB;oaCount++)
                {
                    String oaId = OA_INSTANCE_NAME+oaCount;
                    logInformation("Initialising OA instance '"+oaId+"' for ORB Instance '"+orbId+"'");

                    Policy p[] = new Policy[1];
                    p[0] = rootOA.rootPoa().create_implicit_activation_policy(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION);
                    OA oa = rootOA.createPOA(oaId, p);
                    preInitExpectedValue++;
                    myPoaExceptedValue++;
                }

                if (PreInitialisation2._count != myPoaExceptedValue)
                {
                    logInformation("Checking: Failed, Pre-initialisation of mypoa class not called as expected");
                    assertFailure();
                }
                else
                {
                    logInformation("Checking: myPOA Correct ("+myPoaExceptedValue+")");
                }


                if (PreInitialisation._count != preInitExpectedValue)
                {
                    logInformation("Checking: Failed, Pre-initialisation class not called as expected");
                    assertFailure();
                }
                else
                {
                    logInformation("Checking: Correct ("+preInitExpectedValue+")");
                }
            }
        }
        catch (Exception e)
        {
            logInformation("ERROR - "+e);
            e.printStackTrace(System.err);
            assertFailure();
        }

        for (int orbCount=0;orbCount<numberOfORBs;orbCount++)
        {
            try
            {
                String orbId = ORB_INSTANCE_NAME+orbCount;
                ORB orb = ORB.getInstance(orbId);

                RootOA oa = RootOA.getRootOA(orb);
                oa.destroy();
                orb.destroy();
            }
            catch (Exception e)
            {
                logInformation("ERROR - While destroying ORB instance '"+ORB_INSTANCE_NAME+orbCount+"' ("+e+")");
                e.printStackTrace(System.err);
View Full Code Here

public class SimpleServer extends Test
{
    public void run(String[] args)
    {
        ORB orb = ORB.getInstance("main_orb");
        ORB orb2 = ORB.getInstance("main_orb_2");
        RootOA oa = RootOA.getRootOA(orb);
        RootOA oa2 = RootOA.getRootOA(orb2);

        try
        {
            orb.initORB(args,null);
            oa.initOA(args);

            orb2.initORB(args,null);
            oa2.initOA(args);
        }
        catch (Exception e)
        {
            logInformation("ERROR - During ORB and OA initialisation ("+e+")");
            e.printStackTrace(System.err);
            assertFailure();
        }

        try
        {
            SimpleObjectImpl obj = new SimpleObjectImpl();

            oa.objectIsReady(obj);

            if (oa.objectIsReady(obj))
            {
                logInformation("Manage to activate a servant on the same OA twice - this is incorrect");
                assertFailure();
            }
            else
            {
                logInformation("Didn't managed to activate a servant on the same OA twice - correct");
            }

            if (oa2.objectIsReady(obj))
            {
                logInformation("OA2 did not contain the servant registered on OA - correct");
                oa2.shutdownObject(obj);
            }
            else
            {
                logInformation("OA2 already contained the servant registered on OA - this is incorrect");
                assertFailure();
            }
            assertSuccess();
        }
        catch (Exception e)
        {
            logInformation("ERROR - During object initialisation ("+e+")");
            e.printStackTrace(System.err);
            assertFailure();
        }
        oa.destroy();
  orb.shutdown();
        oa2.destroy();
  orb2.shutdown();
    }
View Full Code Here

        testProps.setProperty(PostInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb",ORB_INSTANCE_NAME_2),
                "com.hp.mwtests.orbportability.initialisation.postinit.PostInitialisation2");

        System.setProperties(testProps);

        ORB orb = null;

        try
        {
            orb = ORB.getInstance(ORB_INSTANCE_NAME);
            logInformation("Initialising First ORB Instance");
            orb.initORB(args, null);
        }
        catch (Exception e)
        {
            logInformation("ERROR - "+e);
            e.printStackTrace(System.err);
            assertFailure();
        }

        if (!PreInitialisation._called)
        {
            logInformation("FAILED: First ORB instance pre-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("First ORB instance pre-initialisation called");
        }

        if (!PostInitialisation._called)
        {
            logInformation("FAILED: First ORB instance post-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("First ORB instance post-initialisation called");
        }

        if (!PreInitialisation2._called)
        {
            logInformation("Second ORB instance pre-initialisation not called");
        }
        else
        {
            logInformation("FAILED: Second ORB instance pre-initialisation called");
            assertFailure();
        }

        if (!PostInitialisation2._called)
        {
            logInformation("Second ORB instance post-initialisation not called");
        }
        else
        {
            logInformation("FAILED: Second ORB instance post-initialisation called");
            assertFailure();
        }

        if (!AllPreInitialisation._called)
        {
            logInformation("FAILED: All ORB instances pre-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("All ORB instances pre-initialisation called");
        }

        if (!AllPostInitialisation._called)
        {
            logInformation("FAILED: All ORB instances post-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("All ORB instances post-initialisation called");
        }

        try
        {
            /**
             * Reset called flags on All ORB instance pre-initialisation
             */
            AllPreInitialisation._called = false;
            AllPostInitialisation._called = false;
            orb = ORB.getInstance(ORB_INSTANCE_NAME_2);
            logInformation("Initialising Second ORB Instance");
            orb.initORB(args, null);
        }
        catch (Exception e)
        {
            logInformation("ERROR - "+e);
            e.printStackTrace(System.err);
            assertFailure();
        }

        if (!PreInitialisation2._called)
        {
            logInformation("FAILED: Second ORB instance pre-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("Second ORB instance pre-initialisation called");
        }

        if (!PostInitialisation2._called)
        {
            logInformation("FAILED: Second ORB instance post-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("Second ORB instance post-initialisation called");
        }

        if (!AllPreInitialisation._called)
        {
            logInformation("FAILED: All ORB instances pre-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("All ORB instances pre-initialisation called");
        }

        if (!AllPostInitialisation._called)
        {
            logInformation("FAILED: All ORB instances post-initialisation not called");
            assertFailure();
        }
        else
        {
            logInformation("All ORB instances post-initialisation called");
        }

        try
        {
            orb.destroy();
        }
        catch (Exception e)
        {
            logInformation("ERROR - "+e);
            e.printStackTrace(System.err);
View Full Code Here

{
  public static void main(String[] args) throws Exception
  {
    System.setProperty("XAConnectionRecovery1", "ExampleXAConnectionRecovery");

    ORB myORB = null;
    RootOA myOA = null;

    try
    {
      myORB = ORB.getInstance("test");
      myOA = OA.getRootOA(myORB);

      myORB.initORB(args, null);
      myOA.initOA();

      ORBManager.setORB(myORB);
      ORBManager.setPOA(myOA);
    }
View Full Code Here

        log.info("Starting transaction recovery manager");

        try
        {
            /** Create an ORB portability wrapper around the CORBA ORB services orb **/
            ORB orb = ORB.getInstance("jboss-atx");

            org.omg.PortableServer.POA rootPOA = org.omg.PortableServer.POAHelper.narrow(theCorbaORB.resolve_initial_references("RootPOA"));

            orb.setOrb(theCorbaORB);
            OA oa = OA.getRootOA(orb);
            oa.setPOA(rootPOA);

            RecoveryORBManager.setORB(orb);
            RecoveryORBManager.setPOA(oa);
View Full Code Here

             * If the object passed in is an ORB Portability ORB
             * then set it to be the ORB used by the JTS.
             */
            if ( obj instanceof ORB )
            {
                ORB orb = (ORB)obj;

                if ( !( orb instanceof InternalORB ) )
                {
                    if (jtsLogger.logger.isDebugEnabled())
                    {
View Full Code Here

        log.info("Starting transaction recovery manager");

        try
        {
            /** Create an ORB portability wrapper around the CORBA ORB services orb **/
            ORB orb = ORB.getInstance("jboss-atx");

            org.omg.PortableServer.POA rootPOA = org.omg.PortableServer.POAHelper.narrow(theCorbaORB.resolve_initial_references("RootPOA"));

            orb.setOrb(theCorbaORB);
            OA oa = OA.getRootOA(orb);
            oa.setPOA(rootPOA);

            RecoveryORBManager.setORB(orb);
            RecoveryORBManager.setPOA(oa);
View Full Code Here

   * @throws ConnectionException
   *             If the server cannot connect to the infrastructure configured
   */
  public BlackTieServer(String serverName) throws ConfigurationException,
      ConnectionException {
    ORB orb = com.arjuna.orbportability.ORB.getInstance("ClientSide");
    RootOA oa = com.arjuna.orbportability.OA.getRootOA(orb);
    orb.initORB(new String[] {}, null);

    try {
      oa.initOA();
    } catch (Throwable t) {
      throw new ConnectionException(Connection.TPESYSTEM,
View Full Code Here

    private final static String ORB_NAME = "testorb";

    public void run(String[] args)
    {
        boolean staticSet = false;
        ORB myORB = null;
  RootOA myOA = null;

        for (int count=0;count<args.length;count++)
        {
            if ( args[count].equalsIgnoreCase("-setstatically") )
            {
                staticSet = true;
            }
        }

        System.setProperty( PostInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb", ORB_NAME), "com.arjuna.ats.jts.utils.ORBSetup");

  try
  {
      myORB = ORB.getInstance(ORB_NAME);
      myOA = OA.getRootOA(myORB);

            if (staticSet)
            {
                ORBManager.setORB(myORB);
            }

            try
            {
                myORB.initORB(args, null);
                myOA.initOA();

                if (ORBManager.getORB() != myORB)
                {
                    logInformation("The ORB reference returned by ORBManager was not the ORB previously initialised");
                    assertFailure();
                }
                else
                {
                    logInformation("The ORB reference returned by ORBManager is the previously initialised ORB");
                    assertSuccess();
                }
            }
            catch (FatalError e)
            {
                if (staticSet)
                {
                    logInformation("FatalError thrown as expected");
                    assertSuccess();
                }
                else
                {
                    logInformation("Error: "+e);
                    e.printStackTrace(System.err);
                    assertFailure();
                }
            }

            myORB.destroy();
            myOA.destroy();
  }
  catch (Throwable e)
  {
      logInformation("Error: "+e);
View Full Code Here

TOP

Related Classes of com.arjuna.orbportability.ORB

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.