@Typed public class TransactionBeanStorage extends Object
This bean stores information about
@TransactionScoped
contextual instances, their CreationalContext
etc.
We use a RequestScoped bean because this way we don't need to take care about cleaning up any ThreadLocals ourselves. This also makes sure that we subsequently destroy any left over TransactionScoped beans (which should not happen, but who knows). We also don't need to do any fancy synchronization stuff since we are sure that we are always in the same Thread.
Modifier and Type | Method and Description |
---|---|
static TransactionBeanStorage |
activateNewStorage()
Creates a new storage for the current thread
|
String |
activateTransactionScope(String transactionKey)
Activate the TransactionScope with the given qualifier.
|
void |
endAllTransactionScopes()
This will destroy all stored transaction contexts.
|
void |
endTransactionScope(String transactionKey)
End the TransactionScope with the given qualifier.
|
Map<javax.enterprise.context.spi.Contextual,TransactionBeanEntry> |
getActiveTransactionContext() |
String |
getActiveTransactionKey() |
static TransactionBeanStorage |
getStorage() |
static void |
resetStorage()
Removes the current storage
|
void |
startTransactionScope(String transactionKey)
Start the TransactionScope with the given qualifier
|
public static TransactionBeanStorage getStorage()
public static TransactionBeanStorage activateNewStorage()
public static void resetStorage()
public void startTransactionScope(String transactionKey)
transactionKey
- public void endTransactionScope(String transactionKey)
transactionKey
- public String activateTransactionScope(String transactionKey)
startTransactionScope(String)
.transactionKey
- null
if non existspublic String getActiveTransactionKey()
public void endAllTransactionScopes()
public Map<javax.enterprise.context.spi.Contextual,TransactionBeanEntry> getActiveTransactionContext()
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.