static void doWork (String[] args) throws Exception { doWork(args, false); }
/** * Create a new instance and interpose with the specified transaction. * Depending upon the value of the boolean parameter, remember any current * transaction that may be associated with the invoking thread so that it * can be restored once interposition has finished. */ public ExplicitInterposition (Control action, boolean remember) throws InterpositionFailed, SystemException { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("ExplicitInterposition::ExplicitInterposition ( Control action, " + remember + " )"); } _remember = remember; _inUse = false; _oldControl = null; registerTransaction(action); }
public void finalize () { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("ExplicitInterposition.finalize ()"); } if (_inUse) { try { unregisterTransaction(); } catch (Exception e) { jtsLogger.i18NLogger.warn_exunregfail("ExplicitInterposition.finalize"); } } }
public void start(org.omg.CORBA.ORB theCorbaORB) throws Exception { jbossatxLogger.i18NLogger.info_jts_TransactionManagerService_start(); // 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); try { // OTSManager won't play nice unless we explicity bootstrap the portability layer: ORBManager.setORB(orb); ORBManager.setPOA(oa); org.omg.CosTransactions.TransactionFactory factory = com.arjuna.ats.jts.OTSManager.get_factory(); final int resolver = Services.getResolver(); com.arjuna.ats.jts.TransactionServer.registerTransactionManager(resolver, orb, factory); } catch (final Exception ex) { throw new Exception(jbossatxLogger.i18NLogger.get_jts_TransactionManagerService_failed(), ex); } }
ExplicitInterposition ei = new ExplicitInterposition(omgTpc, true); Transaction newTx = tm.getTransaction(); ei.unregisterTransaction();
/** * @message com.arjuna.ats.jts.exunregfail {0} - could not unregister from * transaction! */ public void finalize () { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.DESTRUCTORS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ExplicitInterposition.finalize ()"); } if (_inUse) { try { unregisterTransaction(); } catch (Exception e) { if (jtsLogger.loggerI18N.isWarnEnabled()) { jtsLogger.loggerI18N.warn("com.arjuna.ats.jts.exunregfail", new Object[] { "ExplicitInterposition.finalize" }); } } } }
private final void disassociateContext () throws SystemException { if (_piCurrent != null) { try { int slotId = OTSManager.getLocalSlotId(); if (slotId != -1) { _piCurrent.set_slot(slotId, null); } } catch (InvalidSlot is) { // Something very wrong throw new org.omg.CORBA.INTERNAL(); } } }
OTSManager.destroyControl(controlHandle); jtsLogger.i18NLogger.warn_orbspecific_coordinator_generror("ArjunaTransactionImple.destroyAction", ex1); jtsLogger.i18NLogger.warn_orbspecific_coordinator_generror("ArjunaTransactionImple.destroyAction", ex2); jtsLogger.i18NLogger.warn_orbspecific_coordinator_generror("ArjunaTransactionImple.destroyAction", ex3); jtsLogger.i18NLogger.warn_orbspecific_coordinator_generror("ArjunaTransactionImple.destroyAction", ex4); jtsLogger.i18NLogger.warn_orbspecific_coordinator_generror("ArjunaTransactionImple.destroyAction", ex5); jtsLogger.i18NLogger.warn_orbspecific_coordinator_generror("ArjunaTransactionImple.destroyAction", ex6);
/** * @return the suspended transaction. */ public Transaction suspend () throws javax.transaction.SystemException { if (jtaLogger.logger.isDebugEnabled()) { jtaLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jta.logging.FacilityCode.FAC_JTA, "TransactionManagerImple.suspend"); } try { TransactionImple tx = TransactionImple.getTransaction(); Control theControl = OTSManager.get_current().suspend(); return tx; } catch (Exception e) { javax.transaction.SystemException systemException = new javax.transaction.SystemException(e.toString()); systemException.initCause(e); throw systemException; } }
public Uid getReceivedCoordinatorUid() throws InvalidSlot { Any ctx = _piCurrent.get_slot(OTSManager.getReceivedSlotId()); if (ctx != null && ctx.type().kind().value() != TCKind._tk_null) { PropagationContext theContext = org.omg.CosTransactions.PropagationContextHelper.extract(ctx); if (theContext.current.coord == null) // nothing to use!! return null; else return Helper.getUid(Helper.getUidCoordinator(theContext.current.coord)); } else return null; }
env.setShutdownWrappedOrb(false); org.omg.CosTransactions.TransactionFactory factory = com.arjuna.ats.jts.OTSManager.get_factory(); final int resolver = Services.getResolver(); com.arjuna.ats.jts.TransactionServer.registerTransactionManager(resolver, orb, factory);
ExplicitInterposition ei = new ExplicitInterposition(omgTpc, true); Transaction newTx = tm.getTransaction(); ei.unregisterTransaction();
/** * Create a new instance and interpose with the specified transaction. * Depending upon the value of the boolean parameter, remember any current * transaction that may be associated with the invoking thread so that it * can be restored once interposition has finished. */ public ExplicitInterposition (PropagationContext ctx, boolean remember) throws InterpositionFailed, SystemException { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("ExplicitInterposition::ExplicitInterposition ( PropagationContext ctx, " + remember + " )"); } _remember = remember; _inUse = false; _oldControl = null; registerTransaction(ctx); }
disassociateContext(OTSManager.getLocalSlotId());
Control cont = OTSManager.get_current().get_control();
public static void main (String[] args) { try { doWork(args); } catch (final Exception ex) { ex.printStackTrace(); } }
/** * Create a new instance and interpose with the specified transaction. * Depending upon the value of the boolean parameter, remember any current * transaction that may be associated with the invoking thread so that it * can be restored once interposition has finished. */ public ExplicitInterposition (PropagationContext ctx, boolean remember) throws InterpositionFailed, SystemException { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ExplicitInterposition::ExplicitInterposition ( PropagationContext ctx, " + remember + " )"); } _remember = remember; _inUse = false; _oldControl = null; registerTransaction(ctx); }
private final void associateContext () throws SystemException { if (_piCurrent != null) { try { int slotId = OTSManager.getLocalSlotId(); if (slotId != -1) { org.omg.CORBA.Any localDataAny = ORBManager.getORB().orb().create_any(); localDataAny.insert_string(ThreadUtil.getThreadId()); _piCurrent.set_slot(slotId, localDataAny); } } catch (InvalidSlot is) { // Something very wrong throw new org.omg.CORBA.INTERNAL(); } } }
/** * Create a new instance and interpose with the specified transaction. * Depending upon the value of the boolean parameter, remember any current * transaction that may be associated with the invoking thread so that it * can be restored once interposition has finished. */ public ExplicitInterposition (Control action, boolean remember) throws InterpositionFailed, SystemException { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ExplicitInterposition::ExplicitInterposition ( Control action, " + remember + " )"); } _remember = remember; _inUse = false; _oldControl = null; registerTransaction(action); }
private final void associateContext () throws SystemException { if (_piCurrent != null) { try { int slotId = OTSManager.getLocalSlotId(); if (slotId != -1) { org.omg.CORBA.Any localDataAny = ORBManager.getORB().orb().create_any(); localDataAny.insert_string(ThreadUtil.getThreadId()); _piCurrent.set_slot(slotId, localDataAny); } } catch (InvalidSlot is) { // Something very wrong throw new org.omg.CORBA.INTERNAL(); } } }