Methods Summary |
---|
public void | begin()
javaeeTM.begin();
|
public void | commit()
javaeeTM.commit();
|
public com.sun.xml.ws.tx.coordinator.CoordinationContextInterface | getCoordinationContext()Get the coordination context associated with the current transaction.
Returns null if none set.
return (CoordinationContextInterface) getResource("WSCOOR-SUN");
|
public static com.sun.xml.ws.tx.common.TransactionManagerImpl | getInstance()
return singleton;
|
private static java.lang.reflect.Method | getMethod(java.lang.Class theClass, java.lang.String methodName, java.lang.Class param)
Method method = null;
try {
if (param == null) {
method = theClass.getMethod(methodName);
} else {
method = theClass.getMethod(methodName, param);
}
logger.finest("getMethod", "found Sun App Server 9.1 container specific method via reflection " + theClass.getName() + "." + methodName);
} catch (Exception e) {
logger.finest("getMethod", "reflection lookup of " + theClass.getName() + "." + methodName + "("
+ (param == null ? "" : param.getName())
+ ") failed with handled exception ", e);
}
return method;
|
public int | getRemainingTimeout()Returns in seconds duration till current transaction times out.
Returns negative value if transaction has already timedout.
Returns 0 if there is no timeout.
Returns 0 if any exceptions occur looking up remaining transaction timeout.
final String METHOD="getRemainingTimeout";
try {
return TransactionImportManager.getInstance().getTransactionRemainingTimeout();
} catch (SystemException se) {
if (logger.isLogging(Level.FINEST)) {
logger.finest(METHOD, "getRemainingTimeout stack trace", se);
} else {
logger.info(METHOD,
LocalizationMessages.TXN_MGR_OPERATION_FAILED_2008("getTransactionRemainingTimeout",
se.getLocalizedMessage()));
}
} catch (Throwable t) {
if (logger.isLogging(Level.FINEST)) {
logger.finest(METHOD, "getTransactionRemainingTimeout() failed, default to no timeout" );
} else {
logger.info(METHOD, LocalizationMessages.TXN_MGR_OPERATION_FAILED_2008("getTransactionRemainingTimeout",
t.getLocalizedMessage()));
}
}
return 0;
|
public java.lang.Object | getResource(java.lang.Object object)
return javaeeSynchReg.getResource(object);
|
public boolean | getRollbackOnly()
return javaeeSynchReg.getRollbackOnly();
|
public int | getStatus()
return javaeeTM.getStatus();
|
public javax.transaction.Transaction | getTransaction()
return javaeeTM.getTransaction();
|
public java.lang.Object | getTransactionKey()
return javaeeSynchReg.getTransactionKey();
|
javax.transaction.TransactionManager | getTransactionManager()
return javaeeTM;
|
public int | getTransactionStatus()
return javaeeSynchReg.getTransactionStatus();
|
public javax.transaction.UserTransaction | getUserTransaction()
return (UserTransaction)jndiLookup(USER_TRANSACTION_JNDI_NAME);
|
private void | initServletMethods()
if (initialized == false) {
initialized = true;
servletPreInvokeTxMethod = getMethod(javaeeTM.getClass(), "servletPreInvokeTx", null);
servletPostInvokeTxMethod = getMethod(javaeeTM.getClass(), "servletPostInvokeTx", boolean.class);
}
|
public boolean | isTransactionManagerAvailable()
return javaeeTM != null;
|
private static java.lang.Object | jndiLookup(java.lang.String jndiName)
Object result = null;
try {
final Context ctx = new InitialContext();
result = ctx.lookup(jndiName);
} catch (NamingException e) {
logger.fine("jndiLookup", LocalizationMessages.FAILED_JNDI_LOOKUP_2001(jndiName));
}
return result;
|
public void | putResource(java.lang.Object object, java.lang.Object object0)
javaeeSynchReg.putResource(object, object0);
|
public void | registerInterposedSynchronization(javax.transaction.Synchronization synchronization)
javaeeSynchReg.registerInterposedSynchronization(synchronization);
|
public void | registerSynchronization(javax.transaction.Synchronization sync)
final String METHOD="registerSynchronization";
if (sync == null) {
return;
}
Transaction txn = null;
try {
txn = javaeeTM.getTransaction();
} catch (SystemException ex) {
logger.info(METHOD, LocalizationMessages.OPERATION_FAILED_2010("getTransaction"), ex);
}
if (txn == null) {
logger.warning(METHOD, LocalizationMessages.REGISTER_SYNCH_NO_CURRENT_TXN_2011(sync.getClass().getName()));
} else {
try {
txn.registerSynchronization(sync);
} catch (IllegalStateException ex) {
logger.info(METHOD, LocalizationMessages.OPERATION_FAILED_2010(METHOD), ex);
} catch (RollbackException ex) {
logger.info(METHOD, LocalizationMessages.OPERATION_FAILED_2010(METHOD), ex);
} catch (SystemException ex) {
logger.info(METHOD, LocalizationMessages.OPERATION_FAILED_2010(METHOD), ex);
}
}
|
public void | resume(javax.transaction.Transaction transaction)
javaeeTM.resume(transaction);
servletPreInvokeTx();
|
public void | rollback()
javaeeTM.rollback();
|
public void | servletPostInvokeTx(java.lang.Boolean suspend)PostInvoke Transaction configuration for Servlet Container.
BaseContainer.preInvokeTx() handles all this for CMT EJB.
Precondition: assumed called prior to current transcation being suspended or released.
Note: this method is a no-op when invoked on an EJB. The J2EE method only has an effect
on servlets.
final String METHOD = "servletPostInvokeTx";
initServletMethods();
if (servletPostInvokeTxMethod != null) {
try {
servletPostInvokeTxMethod.invoke(javaeeTM, suspend);
} catch (Throwable ex) {
logger.info(METHOD, LocalizationMessages.OPERATION_FAILED_2010(METHOD), ex);
}
}
|
public void | servletPreInvokeTx()PreInvoke Transaction configuration for Servlet Container.
BaseContainer.preInvokeTx() handles all this for CMT EJB.
Compensate that J2EEInstanceListener.handleBeforeEvent(BEFORE_SERVICE_EVENT)
gets called before WSIT WSTX Service pipe associates a JTA txn with incoming thread.
Precondition: assumes JTA transaction already associated with current thread.
Note: this method is a no-op when invoked on an EJB.
final String METHOD = "servletPreInvokeTx";
initServletMethods();
if (servletPreInvokeTxMethod != null) {
try {
servletPreInvokeTxMethod.invoke(javaeeTM);
} catch (Throwable ex) {
logger.info(METHOD, LocalizationMessages.OPERATION_FAILED_2010(METHOD), ex);
}
}
|
public void | setCoordinationContext(com.sun.xml.ws.tx.coordinator.CoordinationContextInterface coordCtx)Set the coordination context associated with the current transaction.
putResource("WSCOOR-SUN", coordCtx);
|
public void | setRollbackOnly()
javaeeSynchReg.setRollbackOnly();
|
public void | setTransactionTimeout(int seconds)
javaeeTM.setTransactionTimeout(seconds);
|
public javax.transaction.Transaction | suspend()
servletPostInvokeTx(true);
return javaeeTM.suspend();
|