public abstract class AbstractTransaction extends Object implements Transaction
Modifier and Type | Method and Description |
---|---|
abstract void |
commit()
Attempt to commit this transaction.
|
int |
getEstimatedRemainingTime()
Get an estimate of the amount of time remaining in this transaction.
|
<T> T |
getProviderInterface(Class<T> providerInterfaceType)
Get a provider-specific interface from this transaction.
|
abstract int |
getTransactionTimeout()
Get the transaction timeout that was in force when the transaction began.
|
<E extends Exception> |
performAction(org.wildfly.common.function.ExceptionRunnable<E> action) |
<T,U,E extends Exception> |
performConsumer(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> consumer,
T param1,
U param2) |
<T,E extends Exception> |
performConsumer(org.wildfly.common.function.ExceptionConsumer<T,E> consumer,
T param) |
<T,E extends Exception> |
performConsumer(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> consumer,
T param1,
int param2) |
<T,U,R,E extends Exception> |
performFunction(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> function,
T param1,
U param2) |
<T,R,E extends Exception> |
performFunction(org.wildfly.common.function.ExceptionFunction<T,R,E> function,
T param) |
<R,E extends Exception> |
performSupplier(org.wildfly.common.function.ExceptionSupplier<R,E> function) |
<T,U,E extends Exception> |
performToIntFunction(org.wildfly.common.function.ExceptionToIntBiFunction<T,U,E> function,
T param1,
U param2) |
<T,E extends Exception> |
performToIntFunction(org.wildfly.common.function.ExceptionToIntFunction<T,E> function,
T param) |
void |
registerAssociationListener(AssociationListener associationListener)
Register an association listener for this transaction, which will be called any time this thread is suspended
or resumed.
|
abstract void |
rollback()
Rolls back this transaction.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
delistResource, enlistResource, getStatus, registerSynchronization, setRollbackOnly
public abstract int getTransactionTimeout()
public final int getEstimatedRemainingTime()
public <T> T getProviderInterface(Class<T> providerInterfaceType)
T
- the provider interface typeproviderInterfaceType
- the provider interface type class (must not be null
)null
if the given type isn't supported by this transaction's providerpublic void registerAssociationListener(AssociationListener associationListener)
associationListener
- the association listener (must not be null
)public abstract void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, SystemException
Transaction
commit
in interface Transaction
RollbackException
- If the transaction was marked for rollback
only, the transaction is rolled back and this exception is
thrown.HeuristicMixedException
- If a heuristic decision was made and
some some parts of the transaction have been committed while
other parts have been rolled back.HeuristicRollbackException
- If a heuristic decision to roll
back the transaction was made.SecurityException
- If the caller is not allowed to commit this
transaction.SystemException
- If the transaction service fails in an
unexpected way.public abstract void rollback() throws IllegalStateException, SystemException
Transaction
rollback
in interface Transaction
IllegalStateException
- If the transaction is in a state
where it cannot be rolled back. This could be because the
transaction is no longer active, or because it is in the
prepared state
.SystemException
- If the transaction service fails in an
unexpected way.public <T,U,R,E extends Exception> R performFunction(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> function, T param1, U param2) throws E extends Exception, SystemException
E extends Exception
SystemException
public <T,R,E extends Exception> R performFunction(org.wildfly.common.function.ExceptionFunction<T,R,E> function, T param) throws E extends Exception, SystemException
E extends Exception
SystemException
public <R,E extends Exception> R performSupplier(org.wildfly.common.function.ExceptionSupplier<R,E> function) throws E extends Exception, SystemException
E extends Exception
SystemException
public <T,E extends Exception> void performConsumer(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> consumer, T param1, int param2) throws E extends Exception, SystemException
E extends Exception
SystemException
public <T,U,E extends Exception> void performConsumer(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> consumer, T param1, U param2) throws E extends Exception, SystemException
E extends Exception
SystemException
public <T,E extends Exception> void performConsumer(org.wildfly.common.function.ExceptionConsumer<T,E> consumer, T param) throws E extends Exception, SystemException
E extends Exception
SystemException
public <T,U,E extends Exception> int performToIntFunction(org.wildfly.common.function.ExceptionToIntBiFunction<T,U,E> function, T param1, U param2) throws E extends Exception, SystemException
E extends Exception
SystemException
public <T,E extends Exception> int performToIntFunction(org.wildfly.common.function.ExceptionToIntFunction<T,E> function, T param) throws E extends Exception, SystemException
E extends Exception
SystemException
public <E extends Exception> void performAction(org.wildfly.common.function.ExceptionRunnable<E> action) throws E extends Exception, SystemException
E extends Exception
SystemException
Copyright © 2017 JBoss by Red Hat. All rights reserved.