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 **/
com.arjuna.ats.arjuna.common.arjPropertyManager.propertyManager.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);