Search in sources :

Example 1 with ContextPropagationManager

use of com.arjuna.ats.internal.jts.context.ContextPropagationManager in project wildfly by wildfly.

the class Util method presetOrb.

public static void presetOrb() throws InvalidName, SystemException {
    Properties properties = new Properties();
    properties.setProperty(ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY, "15151");
    properties.setProperty(ORBConstants.ORB_SERVER_ID_PROPERTY, "1");
    new ContextPropagationManager();
    org.omg.CORBA.ORB sunOrb = org.omg.CORBA.ORB.init(new String[0], properties);
    orb = com.arjuna.orbportability.ORB.getInstance("ClientSide");
    orb.setOrb(sunOrb);
    OA oa = OA.getRootOA(orb);
    org.omg.PortableServer.POA rootPOA = org.omg.PortableServer.POAHelper.narrow(sunOrb.resolve_initial_references("RootPOA"));
    oa.setPOA(rootPOA);
    oa.initOA();
    ORBManager.setORB(orb);
    ORBManager.setPOA(oa);
    // Recovery manager has to be started on client when we want recovery
    // and we start the transaction on client
    recoveryManagerPool = Executors.newFixedThreadPool(1);
    recoveryManagerPool.submit(new Callable<String>() {

        @Override
        public String call() throws Exception {
            RecoveryManager.main(new String[] { "-test" });
            return "Running recovery manager";
        }
    });
}
Also used : OA(com.arjuna.orbportability.OA) Properties(java.util.Properties) ContextPropagationManager(com.arjuna.ats.internal.jts.context.ContextPropagationManager) SystemException(org.omg.CORBA.SystemException) NamingException(javax.naming.NamingException)

Aggregations

ContextPropagationManager (com.arjuna.ats.internal.jts.context.ContextPropagationManager)1 OA (com.arjuna.orbportability.OA)1 Properties (java.util.Properties)1 NamingException (javax.naming.NamingException)1 SystemException (org.omg.CORBA.SystemException)1