public class TransactionAwareSingleton<T> extends TransactionListenerAdapter
private static final TransactionAwareSingleton
All modifications to the singleton via get()
and put(Object)
are made in a
transaction-local manner and promoted to the shared value in a thread-safe manner upon
transacton completion. Transaction-local changes take precedence over the shared value.
AlfrescoTransactionSupport
Constructor and Description |
---|
TransactionAwareSingleton() |
Modifier and Type | Method and Description |
---|---|
void |
afterCommit()
Promotes the storage value to the single value, if required
|
T |
get() |
void |
put(T value)
Store the value in a transaction- and thread-safe manner.
|
afterRollback, beforeCommit, beforeCompletion, flush
public T get()
public void put(T value)
value
- the value to storepublic void afterCommit()
afterCommit
in interface org.alfresco.util.transaction.TransactionListener
afterCommit
in class TransactionListenerAdapter
Copyright © 2005–2017 Alfresco Software. All rights reserved.