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 OTSThread method run.
public void run() {
if (_currentControl != null) {
try {
CurrentImple current = OTSImpleManager.current();
if (current != null) {
current.resume(_currentControl);
current = null;
}
} catch (Exception e) {
jtsLogger.i18NLogger.warn_thread_resumefailed("OTSThread.run", e);
throw new FatalError("OTSThread.run - " + jtsLogger.i18NLogger.get_thread_resumefailederror(), e);
}
_currentControl = null;
}
}
use of com.arjuna.ats.internal.jts.orbspecific.CurrentImple in project narayana by jbosstm.
the class tx method tx_rollback.
/**
* This needs to implement checked transactions such that only the
* transaction initiator (thread) can terminate it.
*/
public static final synchronized int tx_rollback() {
int toReturn = tx.TX_OK;
CurrentImple current = OTSImpleManager.current();
try {
current.rollback();
} catch (NoTransaction e1) {
toReturn = tx.TX_NO_BEGIN;
} catch (Exception e2) {
toReturn = tx.TX_FAIL;
}
return toReturn;
}
use of com.arjuna.ats.internal.jts.orbspecific.CurrentImple in project narayana by jbosstm.
the class tx method tx_set_transaction_timeout.
public static final synchronized int tx_set_transaction_timeout(int timeout) {
int toReturn = tx.TX_OK;
CurrentImple current = OTSImpleManager.current();
try {
current.set_timeout(timeout);
} catch (Exception e) {
toReturn = tx.TX_FAIL;
}
return toReturn;
}
use of com.arjuna.ats.internal.jts.orbspecific.CurrentImple in project narayana by jbosstm.
the class tx method tx_begin.
public static final synchronized int tx_begin() {
int toReturn = tx.TX_OK;
CurrentImple current = OTSImpleManager.current();
if (!__tx_allow_nesting) {
try {
Control control = current.get_control();
if (control != null) {
/*
* Have a transaction already, and not allowed to
* create nested transactions!
*/
toReturn = tx.TX_PROTOCOL_ERROR;
control = null;
}
} catch (Exception e) {
// something went wrong!
toReturn = tx.TX_FAIL;
}
}
if (toReturn == tx.TX_OK) {
try {
current.begin();
} catch (Exception e) {
toReturn = tx.TX_FAIL;
}
}
return toReturn;
}
Aggregations