Top Description Inners Fields Constructors Methods
org.glassfish.gmbal.impl

public Class JMXRegistrationManager

extends Object
Class Inheritance
Imports
java.util.LinkedHashSet, .Map, javax.management.InstanceAlreadyExistsException, .InstanceNotFoundException, .JMException, .MBeanRegistrationException, .NotCompliantMBeanException, .ObjectName, org.glassfish.external.amx.MBeanListener, org.glassfish.gmbal.GmbalException, org.glassfish.pfl.basic.func.UnaryVoidFunction

A simple class that implements deferred registration. When registration is suspended, mbean registrations are queued until registration is resumed, at which time the registration are processed in order.
Author
ken

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private JMXRegistrationManager.RootParentListener
private final LinkedHashSet<MBeanImpl>
pack-priv boolean
pack-priv final Object
private final ManagedObjectManagerInternal
pack-priv MBeanImpl
private final ObjectName
private MBeanListener<T extends MBeanListener.Callback>
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public void
register(MBeanImpl
The MBeanImpl to register
mb
)

Handle registration of this MBean.

public void
resumeRegistration()

Decrement the suspended registration count.

public void
setRoot(MBeanImpl
The root of the tree.
root
)

Set the MBeanImpl that is the root of this MBean tree.

public void
suspendRegistration()

Increment the suspended registration count.

public void
unregister(MBeanImpl
The MBean to unregister.
mb
)

Unregister the MBean.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbackback to summary
private JMXRegistrationManager.RootParentListener callback
deferredRegistrationsback to summary
private final LinkedHashSet<MBeanImpl> deferredRegistrations
isJMXRegistrationEnabledback to summary
pack-priv boolean isJMXRegistrationEnabled
lockback to summary
pack-priv final Object lock
momback to summary
private final ManagedObjectManagerInternal mom
rootback to summary
pack-priv MBeanImpl root
rootParentNameback to summary
private final ObjectName rootParentName
rpListenerback to summary
private MBeanListener<T extends MBeanListener.Callback> rpListener
suspendCountback to summary
private int suspendCount

Constructor Detail

JMXRegistrationManagerback to summary
public JMXRegistrationManager(ManagedObjectManagerInternal mom, ObjectName rootParentName)

Method Detail

clearback to summary
pack-priv void clear()
registerback to summary
public void register(MBeanImpl mb) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException

Handle registration of this MBean. If we are suspended, simply add to the deferredRegistrationList and mark the MBean as suspended. If we are not suspended, then register if JMX registration is enabled.

Parameters
mb:MBeanImpl

The MBeanImpl to register

resumeRegistrationback to summary
public void resumeRegistration()

Decrement the suspended registration count. If the count goes to zero. all registrations that occurred while suspendCount > 0 are registered with the JMX server, UNLESS isJMXRegistrationEnabled is false, in which case we simply clear the deferredRegistrations list, because all MBean will be registered once the root is available.

setRootback to summary
public void setRoot(MBeanImpl root) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException

Set the MBeanImpl that is the root of this MBean tree. Must be set before other methods are called (but this is not enforced).

Parameters
root:MBeanImpl

The root of the tree.

suspendRegistrationback to summary
public void suspendRegistration()

Increment the suspended registration count. All registrations with JMX are suspended while suspendCount > 0.

unregisterback to summary
public void unregister(MBeanImpl mb) throws InstanceNotFoundException, MBeanRegistrationException

Unregister the MBean. If we are suspended, remove from the deferredRegistrations list and mark suspended false. In any case, we unregister from JMX if JMX registration is enabled. Note that we may call unregister on an unregistered object if suspendCount > 0, but that's OK, because MBean.unregister does nothing if mb is not registered.

Parameters
mb:MBeanImpl

The MBean to unregister.

org.glassfish.gmbal.impl back to summary

private Class JMXRegistrationManager.RootParentListener

extends Object
implements Callback
Class Inheritance
  • java.lang.Object
  • org.glassfish.gmbal.impl.JMXRegistrationManager.RootParentListener
All Implemented Interfaces
org.glassfish.external.amx.MBeanListener.Callback

Field Summary

Modifier and TypeField and Description
private final UnaryVoidFunction<MBeanImpl>
REGISTER_FUNC

References Deprecated UnaryVoidFunction is deprecated or references (maybe indirectly) at least one deprecated element.
private final UnaryVoidFunction<MBeanImpl>
UNREGISTER_FUNC

References Deprecated UnaryVoidFunction is deprecated or references (maybe indirectly) at least one deprecated element.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public void
private void
traverse(MBeanImpl mb, UnaryVoidFunction<MBeanImpl> pre, UnaryVoidFunction<MBeanImpl> post)
References Deprecated UnaryVoidFunction is deprecated or references (maybe indirectly) at least one deprecated element.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

REGISTER_FUNCback to summary
private final UnaryVoidFunction<MBeanImpl> REGISTER_FUNC

References Deprecated

UnaryVoidFunction is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

UNREGISTER_FUNCback to summary
private final UnaryVoidFunction<MBeanImpl> UNREGISTER_FUNC

References Deprecated

UnaryVoidFunction is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructor Detail

RootParentListenerback to summary
private RootParentListener()

Method Detail

mbeanRegisteredback to summary
public void mbeanRegistered(ObjectName arg0, MBeanListener<T extends MBeanListener.Callback> arg1)

Implements org.glassfish.external.amx.MBeanListener.Callback.mbeanRegistered.

mbeanUnregisteredback to summary
public void mbeanUnregistered(ObjectName arg0, MBeanListener<T extends MBeanListener.Callback> arg1)

Implements org.glassfish.external.amx.MBeanListener.Callback.mbeanUnregistered.

traverseback to summary
private void traverse(MBeanImpl mb, UnaryVoidFunction<MBeanImpl> pre, UnaryVoidFunction<MBeanImpl> post)

References Deprecated

UnaryVoidFunction is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.