Package com.arjuna.orbportability

Examples of com.arjuna.orbportability.ORB


      logInformation( " Current State : "+ PrettyPrintState( _currentState ) );
    }
 
    public void run(String[] args)
    {
        ORB orb = ORB.getInstance("main_orb");
        RootOA oa = RootOA.getRootOA(orb);

  try
  {
/*
       * Initialise the ORB and OA
       */
      logInformation("Initialising ORB and OA");
     
      orb.initORB(args, null);
      oa.initOA();
     
      _currentState = NONE;
  }
  catch (Exception e)
  {
      logInformation("Initialisation failed: "+e);
      e.printStackTrace();
      assertFailure();
  }
 
  /**
   * Register pre and post shutdown handlers
   */
  orb.addPreShutdown( new TestPreShutdown( "PreShutdown", this ) );
  orb.addPostShutdown( new TestPostShutdown( "PostShutdown", this ) );

/*
   * Shutdown ORB and OA
   */
  logInformation("Shutting down ORB and OA");
  oa.destroy();
  orb.shutdown();
 
  /*
   * Ensure final state is correct
   */
  logInformation("Final state: " + PrettyPrintState(_currentState) );
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

      logInformation(" Current State: " + getStateText(_currentState));
    }

    public void run(String[] args)
    {
        ORB orb = ORB.getInstance("main_orb");
        RootOA oa = RootOA.getRootOA(orb);

  try
  {
      _currentState = NONE;

      /*
       * Registering attributes with ORB
       */
      orb.addAttribute( new PreTestAttribute( this ) );
      orb.addAttribute( new PostTestAttribute( this ) );

            /*
       * Initialise the ORB and OA
       */
      logInformation("Initialising ORB and OA");
     
      orb.initORB(args, null);
      oa.initOA();
     
      if (_currentState == POSTINIT)
        assertSuccess();     
      else
        assertFailure();
  }
  catch (Exception e)
  {
      logInformation("Initialisation failed: "+e);
      e.printStackTrace();
      assertFailure();
  }
 
  oa.destroy();
  orb.shutdown();
    }  
View Full Code Here

    testProps.setProperty(PostSetLoader.generateORBPropertyName("com.arjuna.orbportability.orb", ORB_INSTANCE_NAME2),
        "com.hp.mwtests.orbportability.initialisation.postset.SinglePostSetUsingInterface");

    System.setProperties(testProps);

    ORB orb = null;
        ORB orb2 = null;

    try
    {
      orb = ORB.getInstance(ORB_INSTANCE_NAME);
      orb.initORB(args, null);

      orb2 = ORB.getInstance(ORB_INSTANCE_NAME2);

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

public class JTATransactionCommitTest extends Test
{
    public void run(String[] args)
    {
        ORB orb = ORB.getInstance("test-orb");
        OA oa = OA.getRootOA(orb);

        try
        {
            orb.initORB(args, null);
            oa.initPOA(args);
        }
        catch (Exception e)
        {
            System.out.println("Failed to setup and initiate ORB: "+e);
            assertFailure();
        }

        /** Ensure underlying JTA implementation is JTS **/
        jtaPropertyManager.propertyManager.setProperty(Environment.JTA_TM_IMPLEMENTATION, TransactionManagerImple.class.getName());

        try
        {
            TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();

            System.out.println("Beginning new transaction");
            tm.begin();

            Transaction tx = tm.suspend();

            System.out.println("Beginning second transaction");
            tm.begin();

            System.out.println("Committing original transaction (via Transaction interface)");
            tx.commit();

            System.out.println("Committing second transaction (via TransactionManager interface)");
            tm.commit();

            assertSuccess();
        }
        catch (Exception e)
        {
            System.out.println("Unexpected exception: "+e);
            e.printStackTrace(System.err);
            assertFailure();
        }

        try
        {
            oa.destroy();
            orb.shutdown();
        }
        catch (Exception e)
        {
            System.out.println("Failed to shutdown and destroy the ORB/OA: "+e);
            e.printStackTrace(System.err);
View Full Code Here

  synchronized(startedLock)
  {
      started = true ;
  }
 
        ORB orb = null;

        this.getLog().info("JBossTS Transaction Service - JBoss Inc.");

        this.getLog().info("Setting up property manager MBean and JMX layer");

        // recovery manager properties must be installed before the tx system is initialized. JBTM-598
        arjPropertyManager.propertyManager = PropertyManagerFactory.getPropertyManager("com.arjuna.ats.propertymanager", "recoverymanager");
        Utility.getpid(); // socketProcessId needs to own the port, not the tsm. yuck.
       
        /** Set the tsmx agent implementation to the local JBOSS agent impl **/
        LocalJBossAgentImpl.setLocalAgent(this.getServer());
        System.setProperty(com.arjuna.ats.tsmx.TransactionServiceMX.AGENT_IMPLEMENTATION_PROPERTY,
                com.arjuna.ats.internal.jbossatx.agent.LocalJBossAgentImpl.class.getName());
        System.setProperty(Environment.LAST_RESOURCE_OPTIMISATION_INTERFACE, LastResource.class.getName()) ;
       
        final String alwaysPropagateProperty = alwaysPropagateContext ? "YES" : "NO" ;
        System.setProperty(com.arjuna.ats.jts.common.Environment.ALWAYS_PROPAGATE_CONTEXT, alwaysPropagateProperty);

        /** Register management plugin **/
        PropertyManagerFactory.getPropertyManager("com.arjuna.ats.propertymanager", "arjuna").addManagementPlugin(new PropertyServiceJMXPlugin());

        // Associate transaction reaper with our context classloader.
        TransactionReaper.create() ;
       
    /** Register propagation context manager **/
        try
        {
            /** Bind the propagation context manager **/
            bindRef(PROPAGATION_CONTEXT_IMPORTER_JNDI_REFERENCE, com.arjuna.ats.internal.jbossatx.jts.PropagationContextManager.class.getName());
            bindRef(PROPAGATION_CONTEXT_EXPORTER_JNDI_REFERENCE, com.arjuna.ats.internal.jbossatx.jts.PropagationContextManager.class.getName());

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

            /** Retrieve ORB service's ORB and root POA **/
            InitialContext ctx = new InitialContext();
            org.omg.CORBA.ORB orbImpl = (org.omg.CORBA.ORB) ctx.lookup("java:/" + CorbaORBService.ORB_NAME);
            org.omg.PortableServer.POA rootPOA = (org.omg.PortableServer.POA) ctx.lookup("java:/" + CorbaORBService.POA_NAME);

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

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

    {
        /**
         * Try and find this ORB in the hashmap first if
         * its not there then create one and add it
         */
        ORB orb = (ORB)_orbMap.get(uniqueId);

        if (orb == null)
        {
            orb = new InternalORB(uniqueId);

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.