Top Description Methods
org.osgi.service.transaction.control

public Interface TransactionControl

extends TransactionStarter
Annotations
@ProviderType
Imports
org.osgi.annotation.versioning.ProviderType

The interface used by clients to control the active transaction context

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if a transaction is currently active, or if there is a "no transaction" context active
activeScope
()

public boolean

Returns:

true if a transaction is currently active
activeTransaction
()

public TransactionBuilder

Returns:

A builder to complete the creation of the transaction
build
()

Build a transaction context to surround a piece of transactional work

public TransactionContext

Returns:

The current transaction context, which may be a "no transaction" context, or null if there is no active context
getCurrentContext
()

public boolean

Returns:

true if the transaction is marked for rollback
getRollbackOnly
()

Gets the rollback status of the active transaction

public void
ignoreException(Throwable
The exception to ignore
t
)

Marks that the current transaction should not be rolled back if the supplied Exception is thrown by the current transactional work

public void
setRollbackOnly()

Marks the current transaction to be rolled back

Inherited from org.osgi.service.transaction.control.TransactionStarter:
notSupportedrequiredrequiresNewsupports

Method Detail

activeScopeback to summary
public boolean activeScope()
Returns:boolean

true if a transaction is currently active, or if there is a "no transaction" context active

activeTransactionback to summary
public boolean activeTransaction()
Returns:boolean

true if a transaction is currently active

buildback to summary
public TransactionBuilder build()

Build a transaction context to surround a piece of transactional work

Returns:TransactionBuilder

A builder to complete the creation of the transaction

getCurrentContextback to summary
public TransactionContext getCurrentContext()
Returns:TransactionContext

The current transaction context, which may be a "no transaction" context, or null if there is no active context

getRollbackOnlyback to summary
public boolean getRollbackOnly() throws IllegalStateException

Gets the rollback status of the active transaction

Returns:boolean

true if the transaction is marked for rollback

Exceptions
IllegalStateException:
if no transaction is active
ignoreExceptionback to summary
public void ignoreException(Throwable t) throws IllegalStateException

Marks that the current transaction should not be rolled back if the supplied Exception is thrown by the current transactional work

Parameters
t:Throwable

The exception to ignore

Exceptions
IllegalStateException:
if no transaction is active
setRollbackOnlyback to summary
public void setRollbackOnly() throws IllegalStateException

Marks the current transaction to be rolled back

Exceptions
IllegalStateException:
if no transaction is active