public class BeanManager extends Object
javax.ejb.SessionSynchronization
.Constructor and Description |
---|
BeanManager() |
Modifier and Type | Method and Description |
---|---|
static void |
addBean(String key,
Class<?> service)
Add a bean to the list of known user bean classes.
|
static void |
addBean(String key,
Class<?> service,
boolean isSystemBean)
Add a bean to the list of known bean classes.
|
static void |
afterCommit(VoidCallable callable)
Register a callable to be executed after transaction commit.
|
static void |
afterRollback(VoidCallable callable)
Register a callable to be executed after transaction rollback.
|
static void |
beforeCompletion(VoidCallable callable)
Register a callable to be executed before transaction commit.
|
static void |
bindThreadToTransaction(UserTransaction ut) |
static void |
commit()
Commits the transaction and releases all beans.
|
static void |
executeDeferred(VoidCallable callable)
Register a callable to be executed by the EventDispatcher thread after transaction commit.
|
static Object |
getBean(String key)
Gets a bean instance for a bean class registered with a key.
|
static UserTransaction |
getUserTransaction()
The client or the bean manager itself gets a UserTransaction.
|
static UserTransaction |
getUserTransaction(String name)
The client or the bean manager itself gets a UserTransaction.
|
static boolean |
hasActiveUserTransaction() |
static void |
rollback()
Rolls back the transaction and releases all beans.
|
static void |
rollbackTransaction(UserTransaction ut) |
static void |
setExplicitTransactionMode(boolean value)
If set to true, a thread will not get a usertransaction when calling method
getUserTransaction() or
method getUserTransaction(String) with null as parameter. |
static void |
unbindThreadFromTransaction() |
public static void beforeCompletion(VoidCallable callable)
callable
- the VoidCallable to executepublic static void afterCommit(VoidCallable callable)
callable
- the VoidCallable to executepublic static void afterRollback(VoidCallable callable)
callable
- the VoidCallable to executepublic static void executeDeferred(VoidCallable callable)
callable
- the VoidCallable to executepublic static Object getBean(String key)
key
- the key which was used to register a bean classpublic static void addBean(String key, Class<?> service, boolean isSystemBean)
key
- a unique key for the beanservice
- the beans classisSystemBean
- true, if the bean is an internal @enterprise bean. Do not use this call in application code.public static void addBean(String key, Class<?> service)
key
- a unique key for the beanservice
- the beans classpublic static void commit()
public static void rollback()
public static void rollbackTransaction(UserTransaction ut)
public static boolean hasActiveUserTransaction()
public static UserTransaction getUserTransaction()
public static UserTransaction getUserTransaction(String name)
public static void bindThreadToTransaction(UserTransaction ut)
public static void unbindThreadFromTransaction()
public static void setExplicitTransactionMode(boolean value)
getUserTransaction()
or
method getUserTransaction(String)
with null as parameter. Instead an exception will be thrown.@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.