public class TransactionMetadata extends Object
Constructor and Description |
---|
TransactionMetadata() |
Modifier and Type | Method and Description |
---|---|
void |
addMetadata(String key,
Object value)
Add additional metadata.
|
Class<? extends ExceptionHandler> |
getExceptionHandler()
Get the exception handler of the associated transaction.
|
Class<? extends TransactionHandler> |
getHandler()
Get the transaction handler of the associated transaction.
|
Object |
getMetadata(String key)
Get additional metadata.
|
Class<? extends Exception>[] |
getNoRollbackFor()
Get the exception classes on which the associated transaction will NOT be rollbacked.
|
Propagation |
getPropagation()
Get the propagation of the associated transaction.
|
String |
getResource()
Get the name of the transacted resource (must be unique per transaction handler).
|
Class<? extends Exception>[] |
getRollbackOn()
Get the exception classes on which the associated transaction will be rollbacked.
|
Boolean |
isReadOnly()
Check if the associated transaction is read-only.
|
Boolean |
isRollbackOnParticipationFailure()
Check if the associated participating transaction should mark the whole transaction as rollback-only.
|
TransactionMetadata |
mergeFrom(Transactional other)
Merge this instance with metadata defined in a
Transactional annotation,
which has precedence over this instance. |
TransactionMetadata |
mergeFrom(TransactionMetadata other)
Merge this instance with another one, which has precedence (i.e.
|
void |
setExceptionHandler(Class<? extends ExceptionHandler> exceptionHandler)
Set the exception handler of the associated transaction.
|
void |
setHandler(Class<? extends TransactionHandler> handler)
Set the transaction handler of the associated transaction.
|
void |
setNoRollbackFor(Class<? extends Exception>[] noRollbackFor)
Set the exception classes on which the associated transaction will NOT be rollbacked.
|
void |
setPropagation(Propagation propagation)
Set the propagation of the associated transaction.
|
void |
setReadOnly(Boolean readOnly)
Set if the associated transaction is read-only.
|
void |
setResource(String resource)
Set the name of the transacted resource (must be unique per transaction handler).
|
void |
setRollbackOn(Class<? extends Exception>[] rollbackOn)
Set the exception classes on which the associated transaction will be rollbacked.
|
void |
setRollbackOnParticipationFailure(Boolean rollbackOnParticipationFailure)
Set if the associated participating transaction should mark the whole transaction as rollback-only.
|
String |
toString() |
public Propagation getPropagation()
Propagation
instance.public void setPropagation(Propagation propagation)
propagation
- the Propagation
instance.public Boolean isReadOnly()
public void setReadOnly(Boolean readOnly)
readOnly
- true if read-only, false otherwise.public Boolean isRollbackOnParticipationFailure()
public void setRollbackOnParticipationFailure(Boolean rollbackOnParticipationFailure)
rollbackOnParticipationFailure
- true if it marks it as rollback-only, false otherwise.public Class<? extends Exception>[] getRollbackOn()
public void setRollbackOn(Class<? extends Exception>[] rollbackOn)
rollbackOn
- the exception classes array.public Class<? extends Exception>[] getNoRollbackFor()
public void setNoRollbackFor(Class<? extends Exception>[] noRollbackFor)
noRollbackFor
- the exception classes array.public Class<? extends TransactionHandler> getHandler()
public void setHandler(Class<? extends TransactionHandler> handler)
handler
- the transaction handler class.public String getResource()
public void setResource(String resource)
resource
- the name of the transacted resource.public Class<? extends ExceptionHandler> getExceptionHandler()
public void setExceptionHandler(Class<? extends ExceptionHandler> exceptionHandler)
exceptionHandler
- the exception handler class.public Object getMetadata(String key)
key
- the key of the metadata to retrieve.public void addMetadata(String key, Object value)
key
- the key of the metadata to add.value
- the value of the metadata to add.public TransactionMetadata mergeFrom(TransactionMetadata other)
other
- the instance to merge from.public TransactionMetadata mergeFrom(Transactional other)
Transactional
annotation,
which has precedence over this instance.other
- the annotation to merge from.Copyright © 2013-2018–2019 SeedStack. All rights reserved.