org.glassfish.admin.mbeanserver
Class PendingConfigBeans

java.lang.Object
  extended by org.glassfish.admin.mbeanserver.PendingConfigBeans
All Implemented Interfaces:
ConfigBeanListener, org.glassfish.hk2.PostConstruct, org.jvnet.hk2.config.TransactionListener

@Service(name="PendingConfigBeans")
public class PendingConfigBeans
extends Object
implements ConfigBeanListener, org.jvnet.hk2.component.PostConstruct, org.jvnet.hk2.config.TransactionListener

Called when ConfigBeans come into the habitat (see GlassfishConfigBean); a job queue is maintained for processing by the AMXConfigLoader, which is lazily loaded.

Author:
llc

Constructor Summary
PendingConfigBeans()
          /** Singleton: there should be only one instance and hence a private constructor.
 
Method Summary
 PendingConfigBeanJob add(org.jvnet.hk2.config.ConfigBean cb, boolean useLatch)
           
 void onEntered(org.glassfish.hk2.Provider<org.jvnet.hk2.config.ConfigBean> provider)
           
 PendingConfigBeanJob peek()
           
 void postConstruct()
           
 boolean remove(org.jvnet.hk2.config.ConfigBean cb)
          Removing a ConfigBean must ensure that all its children are also removed.
 int size()
           
 void swapTransactionListener(org.jvnet.hk2.config.TransactionListener newListener)
          amx-impl has its own TransactionListener which takes over once AMX is loaded.
 PendingConfigBeanJob take()
           
 void transactionCommited(List<PropertyChangeEvent> events)
          This is a workaround for the fact that the onEntered() is not being called in all cases, namely during deployment before AMX has loaded.
 void unprocessedTransactedEvents(List<org.jvnet.hk2.config.UnprocessedChangeEvents> changes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PendingConfigBeans

public PendingConfigBeans()
/** Singleton: there should be only one instance and hence a private constructor. But the framework using this wants to instantiate things with a public constructor.

Method Detail

size

public int size()

postConstruct

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

take

public PendingConfigBeanJob take()
                          throws InterruptedException
Throws:
InterruptedException

peek

public PendingConfigBeanJob peek()
                          throws InterruptedException
Throws:
InterruptedException

onEntered

public void onEntered(org.glassfish.hk2.Provider<org.jvnet.hk2.config.ConfigBean> provider)
Specified by:
onEntered in interface ConfigBeanListener

add

public PendingConfigBeanJob add(org.jvnet.hk2.config.ConfigBean cb,
                                boolean useLatch)

remove

public boolean remove(org.jvnet.hk2.config.ConfigBean cb)
Removing a ConfigBean must ensure that all its children are also removed. This will normally happen if AMX is loaded as a side effect of unregistering MBeans, but if AMX has not loaded we must ensure it directly. This is all caused by an HK2 asymmetry that does not issue REMOVE events for children of removed elements.

TODO: remove all children of the ConfigBean.


swapTransactionListener

public void swapTransactionListener(org.jvnet.hk2.config.TransactionListener newListener)
amx-impl has its own TransactionListener which takes over once AMX is loaded. Note that it is synchronized with transactionCommited() [sic] to avoid a race condition.


transactionCommited

public void transactionCommited(List<PropertyChangeEvent> events)
This is a workaround for the fact that the onEntered() is not being called in all cases, namely during deployment before AMX has loaded. See disableTransactionListener() above.

Specified by:
transactionCommited in interface org.jvnet.hk2.config.TransactionListener

unprocessedTransactedEvents

public void unprocessedTransactedEvents(List<org.jvnet.hk2.config.UnprocessedChangeEvents> changes)
Specified by:
unprocessedTransactedEvents in interface org.jvnet.hk2.config.TransactionListener


Copyright © 2012. All Rights Reserved.