org.jvnet.hk2.config
Class Transactions

java.lang.Object
  extended by org.jvnet.hk2.config.Transactions
All Implemented Interfaces:
PostConstruct, PreDestroy

@Service
public final class Transactions
extends Object
implements PostConstruct, PreDestroy

Transactions is a singleton service that receives transaction notifications and dispatch these notifications asynchronously to listeners.

Author:
Jerome Dochez

Constructor Summary
Transactions()
           
 
Method Summary
 void addListenerForType(Class listenerType, ConfigListener listener)
          adds a listener for a particular config type
 void addTransactionsListener(TransactionListener listener)
          add a new listener to all transaction events.
 List<TransactionListener> currentListeners()
           
 void postConstruct()
          The component has been injected with any dependency and will be placed into commission by the subsystem.
 void preDestroy()
          The component is about to be removed from the registry.
 boolean removeListenerForType(Class listenerType, ConfigListener listener)
          removes a listener for a particular config type
 boolean removeTransactionsListener(TransactionListener listener)
          Removes an existing listener for transaction events
 void waitForDrain()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transactions

public Transactions()
Method Detail

postConstruct

public void postConstruct()
Description copied from interface: PostConstruct
The component has been injected with any dependency and will be placed into commission by the subsystem. Hk2 will catch all unchecked exceptions, and cause the backing inhabitant to be released.

Specified by:
postConstruct in interface PostConstruct

preDestroy

public void preDestroy()
Description copied from interface: PreDestroy
The component is about to be removed from the registry.

Specified by:
preDestroy in interface 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()


Copyright © 2013 Oracle Corporation. All Rights Reserved.