Package org.jvnet.hk2.config
Class Transactions
java.lang.Object
org.jvnet.hk2.config.Transactions
- All Implemented Interfaces:
org.glassfish.hk2.api.PostConstruct,org.glassfish.hk2.api.PreDestroy
@Service
public final class Transactions
extends Object
implements org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy
Transactions is a singleton service that receives transaction notifications and dispatch these
notifications asynchronously to listeners.
- Author:
- Jerome Dochez
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListenerForType(Class listenerType, ConfigListener listener) adds a listener for a particular config typevoidaddTransactionsListener(TransactionListener listener) add a new listener to all transaction events.voidvoidbooleanremoveListenerForType(Class listenerType, ConfigListener listener) removes a listener for a particular config typebooleanRemoves an existing listener for transaction eventsvoid
-
Constructor Details
-
Transactions
public Transactions()
-
-
Method Details
-
postConstruct
public void postConstruct()- Specified by:
postConstructin interfaceorg.glassfish.hk2.api.PostConstruct
-
preDestroy
public void preDestroy()- Specified by:
preDestroyin interfaceorg.glassfish.hk2.api.PreDestroy
-
addListenerForType
adds a listener for a particular config type- Parameters:
listenerType- the config typelistener- the config listener
-
removeListenerForType
removes a listener for a particular config type- Parameters:
listenerType- the config typelistener- the config listener- Returns:
- true if the listener was removed successfully, false otherwise.
-
addTransactionsListener
add a new listener to all transaction events.- Parameters:
listener- to be added.
-
removeTransactionsListener
Removes an existing listener for transaction events- Parameters:
listener- the registered listener- Returns:
- true if the listener unregistration was successful
-
currentListeners
-
waitForDrain
public void waitForDrain()
-