use of com.arjuna.ats.internal.jts.orbspecific.CurrentImple in project narayana by jbosstm.
the class InterpositionThreadSetup method setup.
public void setup() {
/*
* Simply getting (or trying to get) the current tx control
* will ensure that this thread is initialised properly. We
* have to do this because in a POA implementation the receiving
* thread may not be the same one which does the work, so we
* cannot do thread association at the interceptor level. We must
* do it when the invoked method actually gets called.
*/
CurrentImple curr = OTSImpleManager.current();
/*
* Probably separate the underlying work out so that we can
* call that directly. No real harm at present since the hard
* work represents most of the overhead and has to be done
* anyway.
*/
curr.contextManager().associate();
}
use of com.arjuna.ats.internal.jts.orbspecific.CurrentImple in project narayana by jbosstm.
the class ContextThreadSetup method setup.
public void setup() {
/*
* Simply getting (or trying to get) the current tx control
* will ensure that this thread is initialised properly. We
* have to do this because in a POA implementation the receiving
* thread may not be the same one which does the work, so we
* cannot do thread association at the interceptor level. We must
* do it when the invoked method actually gets called.
*/
CurrentImple curr = OTSImpleManager.current();
/*
* Probably separate the underlying work out so that we can
* call that directly. No real harm at present since the hard
* work represents most of the overhead and has to be done
* anyway.
*/
curr.contextManager().associate();
}
use of com.arjuna.ats.internal.jts.orbspecific.CurrentImple in project narayana by jbosstm.
the class TopLevelTransaction method resumeTransaction.
private final void resumeTransaction() {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("TopLevelTransaction::resumeTransaction for " + _originalTransaction);
}
try {
if (_originalTransaction != null) {
CurrentImple current = OTSImpleManager.current();
current.resume(_originalTransaction);
_originalTransaction = null;
}
} catch (Exception e) {
}
}
use of com.arjuna.ats.internal.jts.orbspecific.CurrentImple in project narayana by jbosstm.
the class TopLevelTransaction method begin.
/**
* If nested top-level transaction, save current context for resumption
* later.
*/
public synchronized void begin() throws SystemException, SubtransactionsUnavailable {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("TopLevelTransaction::begin ()");
}
if (_originalTransaction != null) {
throw new INVALID_TRANSACTION();
}
CurrentImple current = OTSImpleManager.current();
_originalTransaction = current.suspend();
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("TopLevelTransaction::begin - suspend transaction " + _originalTransaction);
}
super.begin();
}
use of com.arjuna.ats.internal.jts.orbspecific.CurrentImple in project narayana by jbosstm.
the class ExplicitInterposition method registerTransaction.
private final synchronized void registerTransaction(PropagationContext ctx) throws InterpositionFailed, SystemException {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ExplicitInterposition::registerTransaction ( PropagationContext ctx )");
}
if (_inUse) {
jtsLogger.i18NLogger.warn_excalledagain("ExplicitInterposition.registerTransaction");
throw new InterpositionFailed();
}
if (// invalid
(ctx == null) || (ctx.current.coord == null))
throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION, CompletionStatus.COMPLETED_NO);
_inUse = true;
TransactionFactoryImple _localFactory = OTSImpleManager.factory();
try {
ControlImple cont = _localFactory.recreateLocal(ctx);
CurrentImple current = OTSImpleManager.current();
if (_remember) {
try {
_oldControl = current.suspendWrapper();
} catch (Exception e) {
throw new InterpositionFailed();
}
}
current.resumeImple(cont);
// current.resume(cont.getControl());
cont = null;
} catch (InterpositionFailed ex) {
throw ex;
} catch (Exception e) {
jtsLogger.i18NLogger.warn_eicaughtexception("ExplicitInterposition.registerTransaction(PropagationContext)", e);
throw new InterpositionFailed();
}
}
Aggregations