org.jvnet.hk2.config
Class Transactions

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

@Service
@Scoped(value=org.jvnet.hk2.component.Singleton.class)
public final class Transactions
extends java.lang.Object
implements org.jvnet.hk2.component.PostConstruct, org.jvnet.hk2.component.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(java.lang.Class listenerType, ConfigListener listener)
          adds a listener for a particular config type
 void addTransactionsListener(TransactionListener listener)
          add a new listener to all transaction events.
 java.util.List<TransactionListener> currentListeners()
           
 void postConstruct()
           
 void preDestroy()
           
 boolean removeListenerForType(java.lang.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()
Specified by:
postConstruct in interface org.jvnet.hk2.component.PostConstruct

preDestroy

public void preDestroy()
Specified by:
preDestroy in interface org.jvnet.hk2.component.PreDestroy

addListenerForType

public void addListenerForType(java.lang.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(java.lang.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 java.util.List<TransactionListener> currentListeners()

waitForDrain

public void waitForDrain()


Copyright © 2012 Oracle Corporation. All Rights Reserved.