Package com.arjuna.orbportability

Examples of com.arjuna.orbportability.OA


            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);

            try
View Full Code Here


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

                if ( ( oa != null ) && ( !( oa.getAssociatedORB() instanceof InternalORB ) ) )
                {
                    if (jtsLogger.logger.isDebugEnabled())
                    {
                        jtsLogger.logger.debug( DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,  com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS,
                                                "The JTS OA has been set "+oa);
View Full Code Here

            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);

            try
View Full Code Here

            {
                jtaPropertyManager.propertyManager.setProperty(Environment.JTA_TM_IMPLEMENTATION, com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple.class.getName());
                jtaPropertyManager.propertyManager.setProperty(Environment.JTA_UT_IMPLEMENTATION, com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple.class.getName());

                ORB orb = ORB.getInstance("implicitserver-orb");
                OA oa = OA.getRootOA(orb);

                orb.initORB(args, null);
                oa.initPOA(args);

                org.omg.CORBA.Object obj = orb.orb().string_to_object(getService(args[0]));

                Example.test test = Example.testHelper.narrow(obj);

                TransactionManager.transactionManager().begin();

                test.invoke();

                TransactionManager.transactionManager().commit();

                assertSuccess();

                oa.destroy();
                orb.destroy();
            }
            catch (Exception e)
            {
                e.printStackTrace(System.err);
View Full Code Here

    public ResourceRecordViewer()
    {
        try
        {
            _orb = ORB.getInstance(ORB_NAME);
            OA oa = OA.getRootOA(_orb);

            _orb.initORB((String[])null, null);
            oa.initPOA(null);

            Implementations.initialise();
        }
        catch (Exception e)
        {
View Full Code Here

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

                if ( ( oa != null ) && ( !( oa.getAssociatedORB() instanceof InternalORB ) ) )
                {
                    if (jtsLogger.logger.isDebugEnabled())
                    {
                        jtsLogger.logger.debug( DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,  com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS,
                                                "The JTS OA has been set "+oa);
View Full Code Here

  {
    try
    {
      /** Create ORB and OA **/
      ORB testORB = ORB.getInstance( ORB_INSTANCE_NAME );
      OA testOA = OA.getRootOA( testORB );

      /** Initialise ORB and OA **/
      testORB.initORB(args, null);
      testOA.initPOA(args);

      /** Create services object **/
      Services testServ = new Services(testORB);

      String[] params = new String[1];
      params[0] = com.arjuna.orbportability.Services.otsKind;

      SimpleObjectImpl servant = new com.hp.mwtests.orbportability.orbspecific.orbinstance.SimpleObjectImpl();

      testOA.objectIsReady(servant);

      /*
       * Register using the default mechanism.
       */
      testServ.registerService(com.hp.mwtests.orbportability.orbspecific.orbtests.SimpleObjectHelper.narrow(testOA.corbaReference(servant)), TEST_SERVICE_NAME, params, Services.CONFIGURATION_FILE);

      assertSuccess();
    }
    catch (Exception e)
    {
View Full Code Here

                    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+")");
View Full Code Here

    public void run(String[] args)
    {
        try
        {
            ORB orb = ORB.getInstance( ORB_NAME );
            OA oa = OA.getRootOA( orb );

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

            logInformation("          ORBInfo.getOrbName: "+ORBInfo.getOrbName());
            logInformation("  ORBInfo.getOrbMajorVersion: "+ORBInfo.getOrbMajorVersion());
            logInformation("  ORBInfo.getOrbMinorVersion: "+ORBInfo.getOrbMinorVersion());
            logInformation("ORBInfo.getCorbaMajorVersion: "+ORBInfo.getCorbaMajorVersion());
            logInformation("ORBInfo.getCorbaMinorVersion: "+ORBInfo.getCorbaMinorVersion());
            logInformation("     ORBInfo.getOrbEnumValue: "+ORBInfo.getOrbEnumValue());

            oa.destroy();
            orb.destroy();

            assertSuccess();
        }
        catch (Exception e)
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);
View Full Code Here

TOP

Related Classes of com.arjuna.orbportability.OA

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.