public class AutomaticManagedRuntime extends AbstractManagedRuntime implements ManagedRuntime, Configurable
ManagedRuntime interface that searches
through a set of known JNDI locations and method invocations to locate the
appropriate mechanism for obtaining a TransactionManager.
Built in support is provided for the following Application Servers:
| Constructor and Description |
|---|
AutomaticManagedRuntime() |
| Modifier and Type | Method and Description |
|---|---|
void |
doNonTransactionalWork(Runnable runnable)
Delegate nonTransactional work to the appropriate managed runtime.
|
void |
endConfiguration() |
Throwable |
getRollbackCause()
Returns the Throwable that caused the current transaction to be
marked for rollback, provided that any exists.
|
Object |
getTransactionKey()
Returns a transaction key that can be used to associate transactions
and Brokers.
|
TransactionManager |
getTransactionManager()
Return the TransactionManager for the managed runtime.
|
void |
setConfiguration(Configuration conf) |
void |
setRollbackOnly(Throwable cause)
Sets the rollback only flag on the current transaction.
|
void |
startConfiguration() |
public TransactionManager getTransactionManager() throws Exception
ManagedRuntimegetTransactionManager in interface ManagedRuntimeExceptionpublic void setConfiguration(Configuration conf)
setConfiguration in interface Configurablepublic void startConfiguration()
startConfiguration in interface Configurablepublic void endConfiguration()
endConfiguration in interface Configurablepublic void setRollbackOnly(Throwable cause) throws Exception
ManagedRuntimesetRollbackOnly in interface ManagedRuntimecause - the Throwable that caused the transaction to be
marked for rollback, or null of none is knownExceptionpublic Throwable getRollbackCause() throws Exception
ManagedRuntimegetRollbackCause in interface ManagedRuntimeExceptionpublic Object getTransactionKey() throws Exception, SystemException
AbstractManagedRuntimegetTransactionKey in interface ManagedRuntimegetTransactionKey in class AbstractManagedRuntimeExceptionSystemExceptionpublic void doNonTransactionalWork(Runnable runnable) throws NotSupportedException
AbstractManagedRuntime.doNonTransactionalWork in interface ManagedRuntimedoNonTransactionalWork in class AbstractManagedRuntimerunnable - The runnable wrapper for the work that will be done. The
runnable object should be fully initialized with any state
needed to execute.NotSupportedException - if the current transaction can not be obtained, or an error
occurs when suspending or resuming the transaction.Copyright © 2006-2014 Apache Software Foundation. All Rights Reserved.