Class DelegatingTransactionSynchronizationRegistry
- java.lang.Object
-
- io.helidon.integrations.jta.cdi.DelegatingTransactionSynchronizationRegistry
-
- All Implemented Interfaces:
javax.transaction.TransactionSynchronizationRegistry
@Deprecated(forRemoval=true) public abstract class DelegatingTransactionSynchronizationRegistry extends Object implements javax.transaction.TransactionSynchronizationRegistry
Deprecated, for removal: This API element is subject to removal in a future version.An equivalent class now exists in Narayana itself.AnabstractTransactionSynchronizationRegistryimplementation that delegates all method invocations to anotherTransactionSynchronizationRegistry.Design Notes
This class is
publicfor convenience. It is extended by other non-publicinternal classes.- See Also:
TransactionSynchronizationRegistry
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDelegatingTransactionSynchronizationRegistry(javax.transaction.TransactionSynchronizationRegistry delegate)Deprecated, for removal: This API element is subject to removal in a future version.Creates a newDelegatingTransactionSynchronizationRegistry.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ObjectgetResource(Object key)Deprecated, for removal: This API element is subject to removal in a future version.Gets an object from theMapof resources being managed for the transaction bound to the current thread at the time this method is called.booleangetRollbackOnly()Deprecated, for removal: This API element is subject to removal in a future version.Get therollbackOnlystatus of the transaction bound to the current thread at the time this method is called.ObjectgetTransactionKey()Deprecated, for removal: This API element is subject to removal in a future version.Return an opaque object to represent the transaction bound to the current thread at the time this method is called.intgetTransactionStatus()Deprecated, for removal: This API element is subject to removal in a future version.Return the status of the transaction bound to the current thread at the time this method is called.voidputResource(Object key, Object value)Deprecated, for removal: This API element is subject to removal in a future version.Adds or replaces an object in theMapof resources being managed for the transaction bound to the current thread at the time this method is called.voidregisterInterposedSynchronization(javax.transaction.Synchronization synchronization)Deprecated, for removal: This API element is subject to removal in a future version.Registers aSynchronizationinstance with special ordering semantics.voidsetRollbackOnly()Deprecated, for removal: This API element is subject to removal in a future version.Sets therollbackOnlystatus of the transaction bound to the current thread at the time this method is called.
-
-
-
Constructor Detail
-
DelegatingTransactionSynchronizationRegistry
protected DelegatingTransactionSynchronizationRegistry(javax.transaction.TransactionSynchronizationRegistry delegate)
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newDelegatingTransactionSynchronizationRegistry.- Parameters:
delegate- theTransactionSynchronizationRegistryto which all method invocations will be delegated; may benullin which case every method in this class will throw anIllegalStateExceptionwhen invoked
-
-
Method Detail
-
getTransactionKey
public Object getTransactionKey()
Deprecated, for removal: This API element is subject to removal in a future version.Return an opaque object to represent the transaction bound to the current thread at the time this method is called.This method may return
null.This object overrides
Object.hashCode()andObject.equals(Object)to allow its use as the key in aMapfor use by the caller. If there is no transaction currently active, this method will returnnull.The
Objectreturned will return the same hashCode and compare equal to all other objects returned by calling this method from any component executing in the same transaction context in the same application server.The
Object.toString()method returns aStringthat might be usable by a human reader to usefully understand the transaction context. TheObject.toString()result is otherwise not defined. Specifically, there is no forward or backward compatibility guarantee of the results of the returnedObject'sObject.toString()override.The object is not necessarily serializable, and has no defined behavior outside the virtual machine whence it was obtained.
- Specified by:
getTransactionKeyin interfacejavax.transaction.TransactionSynchronizationRegistry- Returns:
- an opaque object representing the transaction bound to
the current thread at the time this method is called, or
null - Throws:
IllegalStateException- if anulldelegatewas supplied at construction time
-
putResource
public void putResource(Object key, Object value)
Deprecated, for removal: This API element is subject to removal in a future version.Adds or replaces an object in theMapof resources being managed for the transaction bound to the current thread at the time this method is called.The supplied key should be of an caller-defined class so as not to conflict with other users. The class of the key must guarantee that the
hashCode()andequals(Object)methods are suitable for use as keys in aMap. The key and value are not examined or used by the implementation. The general contract of this method is that ofMap.put(Object, Object)for aMapthat supports non-nullkeys and null values. For example, if there is already an value associated with the key, it is replaced by thevalueparameter.- Specified by:
putResourcein interfacejavax.transaction.TransactionSynchronizationRegistry- Parameters:
key- the key for theMapentry; must not benullvalue- the value for theMapentry- Throws:
IllegalStateException- if no transaction is active or if anulldelegatewas supplied at construction timeNullPointerException- if the parameterkeyisnull
-
getResource
public Object getResource(Object key)
Deprecated, for removal: This API element is subject to removal in a future version.Gets an object from theMapof resources being managed for the transaction bound to the current thread at the time this method is called.The key should have been supplied earlier by a call to
putResource(Object, Object)in the same transaction. If the key cannot be found in the current resourceMap,nullis returned. The general contract of this method is that ofMap.get(Object)for aMapthat supports non-nullkeys and null values. For example, the returned value is null if there is no entry for the parameterkeyor if the value associated with the key is actuallynull.- Specified by:
getResourcein interfacejavax.transaction.TransactionSynchronizationRegistry- Parameters:
key- the key for theMapentry- Returns:
- the value associated with the supplied
key; may benull - Throws:
IllegalStateException- if no transaction is active or if anulldelegatewas supplied at construction timeNullPointerException- if the parameterkeyisnull
-
registerInterposedSynchronization
public void registerInterposedSynchronization(javax.transaction.Synchronization synchronization)
Deprecated, for removal: This API element is subject to removal in a future version.Registers aSynchronizationinstance with special ordering semantics.The supplied
Synchronization'sSynchronization.beforeCompletion()method will be called after allSessionSynchronization#beforeCompletion()callbacks and callbacks registered directly with theTransaction, but before the 2-phase commit process starts. Similarly, theSynchronization.afterCompletion(int)callback will be called after 2-phase commit completes but before anySessionSynchronizationandTransactionafterCompletion(int)callbacks.The
Synchronization.beforeCompletion()callback will be invoked in the transaction context of the transaction bound to the current thread at the time this method is called. Allowable methods include access to resources, e.g. connectors. No access is allowed to "user components" (e.g. timer services or bean methods), as these might change the state of data being managed by the caller, and might change the state of data that has already been flushed by another caller ofregisterInterposedSynchronization(Synchronization). The general context is the component context of the caller ofregisterInterposedSynchronization(Synchronization).The
Synchronization.afterCompletion(int)callback will be invoked in an undefined context. No access is permitted to "user components" as defined above. Resources can be closed but no transactional work can be performed with them.If this method is invoked without an active transaction context, an
IllegalStateExceptionis thrown.If this method is invoked after the two-phase commit processing has started, an
IllegalStateExceptionis thrown.- Specified by:
registerInterposedSynchronizationin interfacejavax.transaction.TransactionSynchronizationRegistry- Parameters:
synchronization- theSynchronizationto register; must not benull- Throws:
IllegalStateException- if no transaction is active or two-phase commit processing has started or if anulldelegatewas supplied at construction time- See Also:
Synchronization,Synchronization.beforeCompletion(),Synchronization.afterCompletion(int)
-
getTransactionStatus
public int getTransactionStatus()
Deprecated, for removal: This API element is subject to removal in a future version.Return the status of the transaction bound to the current thread at the time this method is called.This is the result of executing
TransactionManager.getStatus()in the context of the transaction bound to the current thread at the time this method is called.- Specified by:
getTransactionStatusin interfacejavax.transaction.TransactionSynchronizationRegistry- Returns:
- the status of the transaction bound to the current
thread at the time this method is called; will be equal the
value of one of the constants defined in the
Statusclass - Throws:
IllegalStateException- if anulldelegatewas supplied at construction time- See Also:
TransactionManager.getStatus(),Status
-
setRollbackOnly
public void setRollbackOnly()
Deprecated, for removal: This API element is subject to removal in a future version.Sets therollbackOnlystatus of the transaction bound to the current thread at the time this method is called.- Specified by:
setRollbackOnlyin interfacejavax.transaction.TransactionSynchronizationRegistry- Throws:
IllegalStateException- if no transaction is active or if anulldelegatewas supplied at construction time
-
getRollbackOnly
public boolean getRollbackOnly()
Deprecated, for removal: This API element is subject to removal in a future version.Get therollbackOnlystatus of the transaction bound to the current thread at the time this method is called.- Specified by:
getRollbackOnlyin interfacejavax.transaction.TransactionSynchronizationRegistry- Returns:
- the
rollbackOnlystatus - Throws:
IllegalStateException- if no transaction is active or if anulldelegatewas supplied at construction time
-
-