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 Details

    • Transactions

      public Transactions()
  • Method Details

    • postConstruct

      public void postConstruct()
      Specified by:
      postConstruct in interface org.glassfish.hk2.api.PostConstruct
    • preDestroy

      public void preDestroy()
      Specified by:
      preDestroy in interface org.glassfish.hk2.api.PreDestroy
    • addListenerForType

      public void addListenerForType(Class listenerType, ConfigListener listener)
      adds a listener for a particular config type
      Parameters:
      listenerType - the config type
      listener - the config listener
    • removeListenerForType

      public boolean removeListenerForType(Class listenerType, ConfigListener listener)
      removes a listener for a particular config type
      Parameters:
      listenerType - the config type
      listener - the config listener
      Returns:
      true if the listener was removed successfully, false otherwise.
    • addTransactionsListener

      public void addTransactionsListener(TransactionListener listener)
      add a new listener to all transaction events.
      Parameters:
      listener - to be added.
    • removeTransactionsListener

      public boolean removeTransactionsListener(TransactionListener listener)
      Removes an existing listener for transaction events
      Parameters:
      listener - the registered listener
      Returns:
      true if the listener unregistration was successful
    • currentListeners

      public List<TransactionListener> currentListeners()
    • waitForDrain

      public void waitForDrain()