Top Description Fields Constructors Methods
org.glassfish.gmbal

pack-priv Class ManagedObjectManagerNOPImpl

extends Object
implements ManagedObjectManager
Class Inheritance
All Implemented Interfaces
org.glassfish.gmbal.ManagedObjectManager, java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.IOException, java.lang.annotation.Annotation, java.lang.reflect.AnnotatedElement, java.util.ResourceBundle, javax.management.MBeanServer, .ObjectName, org.glassfish.pfl.tf.timer.spi.ObjectRegistrationManager

NOP impl of ManagedObjectManager used when annotations and ManagedObjectManager are needed, but MBeans are not. This allows using gmbal to optionally support MBeans. This is the implementation of the ManagedObjectManager that is used when the full implementation is not available.
Author
ken_admin

Field Summary

Modifier and TypeField and Description
private static final GmbalMBean
pack-priv static final ManagedObjectManager

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
addAnnotation(AnnotatedElement element, Annotation annotation)

Implements org.glassfish.gmbal.ManagedObjectManager.addAnnotation.

Method to add an annotation to an element that cannot be modified.

public void
addInheritedAnnotations(Class<?> cls)

Implements org.glassfish.gmbal.ManagedObjectManager.addInheritedAnnotations.

Add all annotations for this class as if they were declared on the inheritance parent(s) of the class (immediate superclass for a class, all immediate superinterfaces for an interface).

public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public GmbalMBean
createRoot()

Implements org.glassfish.gmbal.ManagedObjectManager.createRoot.

Create a default root MBean.

public GmbalMBean
createRoot(Object root)

Implements org.glassfish.gmbal.ManagedObjectManager.createRoot.

Create a root MBean from root, which much have a method with the @NameValue annotation.

public GmbalMBean
createRoot(Object root, String name)

Implements org.glassfish.gmbal.ManagedObjectManager.createRoot.

Create a root MBean from root with the given name.

public String
dumpSkeleton(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.dumpSkeleton.

Dump the skeleton used in the implementation of the MBean for obj.

public AMXClient
getAMXClient(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.getAMXClient.

Get an AMXClient instance for the object obj, if obj is registered as an MBean in this mom.

public String
getDomain()

Implements org.glassfish.gmbal.ManagedObjectManager.getDomain.

Return the domain name that was used when this ManagedObjectManager was created.

public MBeanServer
public Object
getObject(ObjectName oname)

Implements org.glassfish.gmbal.ManagedObjectManager.getObject.

Get the Object that was registered with the given ObjectName.

public ObjectName
getObjectName(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.getObjectName.

Get the ObjectName for the given object (which must have been registered via a register call).

public ObjectRegistrationManager
getObjectRegistrationManager()

Implements org.glassfish.gmbal.ManagedObjectManager.getObjectRegistrationManager.

Return an ObjectRegistrationManager as required in the pfl timer services.

public ResourceBundle
getResourceBundle()

Implements org.glassfish.gmbal.ManagedObjectManager.getResourceBundle.

Get the resource bundle (if any) set by setResourceBundle.

public Object
getRoot()

Implements org.glassfish.gmbal.ManagedObjectManager.getRoot.

Return the root of this ManagedObjectManager.

public boolean
isManagedObject(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.isManagedObject.

Return true if object is assignment compatible with a class or interface that has an @ManagedObject annotation, otherwise false.

public GmbalMBean
register(Object parent, Object obj, String name)

Implements org.glassfish.gmbal.ManagedObjectManager.register.

Construct an Open Mean for obj according to its annotations, and register it with domain getDomain() and the appropriate ObjectName.

public GmbalMBean
register(Object parent, Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.register.

Same as register( parent, obj, name ), but here the name is derived from an @NameValue annotation.

public GmbalMBean
registerAtRoot(Object obj, String name)

Implements org.glassfish.gmbal.ManagedObjectManager.registerAtRoot.

Registers the MBean for obj at the root MBean for the ObjectManager, using the given name.

public GmbalMBean
registerAtRoot(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.registerAtRoot.

Same as registerAtRoot( Object, String ), but here the name is derived from an @ObjectKeyName annotation.

public void
resumeJMXRegistration()

Implements org.glassfish.gmbal.ManagedObjectManager.resumeJMXRegistration.

Decrements the suspend counter, if the counter is greater than 0.

public void
setJMXRegistrationDebug(boolean flag)

Implements org.glassfish.gmbal.ManagedObjectManager.setJMXRegistrationDebug.

Set debugging for JMX registrations.

public void
setMBeanServer(MBeanServer server)

Implements org.glassfish.gmbal.ManagedObjectManager.setMBeanServer.

Set the MBeanServer to which all MBeans using this interface are published.

public void
public void
setResourceBundle(ResourceBundle rb)

Implements org.glassfish.gmbal.ManagedObjectManager.setResourceBundle.

Set the ResourceBundle to use for getting localized descriptions.

public void
setRuntimeDebug(boolean flag)

Implements org.glassfish.gmbal.ManagedObjectManager.setRuntimeDebug.

Enable generation of debug log at INFO level for runtime MBean operations to the org.glassfish.gmbal.impl logger.

public void
setTypelibDebug(int level)

Implements org.glassfish.gmbal.ManagedObjectManager.setTypelibDebug.

Enabled generation of debug log for type evaluator debugging.

public void
stripPackagePrefix()

Implements org.glassfish.gmbal.ManagedObjectManager.stripPackagePrefix.

Change the default type name algorithm so that if nothing else applies, the entire package prefix is stripped form the Class name.

public void
stripPrefix(String... str)

Implements org.glassfish.gmbal.ManagedObjectManager.stripPrefix.

Add a type prefix to strip from type names, to shorten the names for a better presentation to the user.

public void
suppressDuplicateRootReport(boolean suppressReport)

Implements org.glassfish.gmbal.ManagedObjectManager.suppressDuplicateRootReport.

Suppress reporting of a duplicate root name.

public void
suspendJMXRegistration()

Implements org.glassfish.gmbal.ManagedObjectManager.suspendJMXRegistration.

If called, no MBeans created after this call will be registered with the JMX MBeanServer until resumeJMXRegistration is called.

public void
unregister(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.unregister.

Unregister the Open MBean corresponding to obj from the mbean server.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

gmbback to summary
private static final GmbalMBean gmb
selfback to summary
pack-priv static final ManagedObjectManager self

Constructor Detail

ManagedObjectManagerNOPImplback to summary
private ManagedObjectManagerNOPImpl()

Method Detail

addAnnotationback to summary
public void addAnnotation(AnnotatedElement element, Annotation annotation)

Implements org.glassfish.gmbal.ManagedObjectManager.addAnnotation.

Doc from org.glassfish.gmbal.ManagedObjectManager.addAnnotation.

Method to add an annotation to an element that cannot be modified. This is typically needed when dealing with an implementation of an interface that is part of a standardized API, and so the interface cannot be annotated by modifiying the source code. In some cases the implementation of the interface also cannot be inherited, because the implementation is generated by a standardized code generator. Another possibility is that there are several different implementations of the standardized interface, and it is undesirable to annotate each implementation with @InheritedAttributes.

addInheritedAnnotationsback to summary
public void addInheritedAnnotations(Class<?> cls)

Implements org.glassfish.gmbal.ManagedObjectManager.addInheritedAnnotations.

Doc from org.glassfish.gmbal.ManagedObjectManager.addInheritedAnnotations.

Add all annotations for this class as if they were declared on the inheritance parent(s) of the class (immediate superclass for a class, all immediate superinterfaces for an interface). Also add all method annotations for methods that override an inherited method. This acts as if all annotations on cls were actually applied to the immediate super class or interface.

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Exceptions
IOException:
if an I/O error occurs
createRootback to summary
public GmbalMBean createRoot()

Implements org.glassfish.gmbal.ManagedObjectManager.createRoot.

Doc from org.glassfish.gmbal.ManagedObjectManager.createRoot.

Create a default root MBean. One of the createRoot methods must be called before any of the registration methods may be called. Only one call to a createRoot method is permitted after an ManagedObjectManager is created.

createRootback to summary
public GmbalMBean createRoot(Object root)

Implements org.glassfish.gmbal.ManagedObjectManager.createRoot.

Doc from org.glassfish.gmbal.ManagedObjectManager.createRoot.

Create a root MBean from root, which much have a method with the @NameValue annotation. One of the createRoot methods must be called before any of the registration methods may be called. Only one call to createRoot is permitted after an ManagedObjectManager is created.

createRootback to summary
public GmbalMBean createRoot(Object root, String name)

Implements org.glassfish.gmbal.ManagedObjectManager.createRoot.

Doc from org.glassfish.gmbal.ManagedObjectManager.createRoot.

Create a root MBean from root with the given name. One of the createRoot methods must be called before any of the registration methods may be called. Only one call to createRoot is permitted after an ManagedObjectManager is created.

dumpSkeletonback to summary
public String dumpSkeleton(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.dumpSkeleton.

Doc from org.glassfish.gmbal.ManagedObjectManager.dumpSkeleton.

Dump the skeleton used in the implementation of the MBean for obj. Obj must be currently registered.

Must be called after a successful call to a createRoot method.

getAMXClientback to summary
public AMXClient getAMXClient(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.getAMXClient.

Doc from org.glassfish.gmbal.ManagedObjectManager.getAMXClient.

Get an AMXClient instance for the object obj, if obj is registered as an MBean in this mom.

Must be called after a successful createRoot call.

getDomainback to summary
public String getDomain()

Implements org.glassfish.gmbal.ManagedObjectManager.getDomain.

Doc from org.glassfish.gmbal.ManagedObjectManager.getDomain.

Return the domain name that was used when this ManagedObjectManager was created. This is the JMX domain that will be used in all ObjectNames created by this ManagedObjectManager.

May be called at any time.

getMBeanServerback to summary
public MBeanServer getMBeanServer()

Implements org.glassfish.gmbal.ManagedObjectManager.getMBeanServer.

Doc from org.glassfish.gmbal.ManagedObjectManager.getMBeanServer.

Get the current MBeanServer.

May be called at any time.

getObjectback to summary
public Object getObject(ObjectName oname)

Implements org.glassfish.gmbal.ManagedObjectManager.getObject.

Doc from org.glassfish.gmbal.ManagedObjectManager.getObject.

Get the Object that was registered with the given ObjectName. Note that getObject and getObjectName are inverse operations.

Must be called after a successful createRoot call.

getObjectNameback to summary
public ObjectName getObjectName(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.getObjectName.

Doc from org.glassfish.gmbal.ManagedObjectManager.getObjectName.

Get the ObjectName for the given object (which must have been registered via a register call).

Must be called after a successful createRoot call.

getObjectRegistrationManagerback to summary
public ObjectRegistrationManager getObjectRegistrationManager()

Implements org.glassfish.gmbal.ManagedObjectManager.getObjectRegistrationManager.

Doc from org.glassfish.gmbal.ManagedObjectManager.getObjectRegistrationManager.

Return an ObjectRegistrationManager as required in the pfl timer services.

Can be called at any time.

getResourceBundleback to summary
public ResourceBundle getResourceBundle()

Implements org.glassfish.gmbal.ManagedObjectManager.getResourceBundle.

Doc from org.glassfish.gmbal.ManagedObjectManager.getResourceBundle.

Get the resource bundle (if any) set by setResourceBundle.

May be called at any time.

getRootback to summary
public Object getRoot()

Implements org.glassfish.gmbal.ManagedObjectManager.getRoot.

Doc from org.glassfish.gmbal.ManagedObjectManager.getRoot.

Return the root of this ManagedObjectManager. May be called at any time.

isManagedObjectback to summary
public boolean isManagedObject(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.isManagedObject.

Doc from org.glassfish.gmbal.ManagedObjectManager.isManagedObject.

Return true if object is assignment compatible with a class or interface that has an @ManagedObject annotation, otherwise false. Only such objects may be registered to create MBeans. May be called at any time.

registerback to summary
public GmbalMBean register(Object parent, Object obj, String name)

Implements org.glassfish.gmbal.ManagedObjectManager.register.

Doc from org.glassfish.gmbal.ManagedObjectManager.register.

Construct an Open Mean for obj according to its annotations, and register it with domain getDomain() and the appropriate ObjectName. The MBeanServer from setMBeanServer (or its default) is used. Here parent is considered to contain obj, and this containment is represented by the construction of the ObjectName following the AMX specification for ObjectNames.

The MBeanInfo for the result is actually ModelMBeanInfo, and may contain extra metadata as defined using annotations defined with the @DescriptorKey and @DescriptorField meta-annotations.

Must be called after a successful createRoot call.

This version of register should not be used to register singletons.

registerback to summary
public GmbalMBean register(Object parent, Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.register.

Doc from org.glassfish.gmbal.ManagedObjectManager.register.

Same as register( parent, obj, name ), but here the name is derived from an @NameValue annotation.

This version of register should also be used to register singletons.

registerAtRootback to summary
public GmbalMBean registerAtRoot(Object obj, String name)

Implements org.glassfish.gmbal.ManagedObjectManager.registerAtRoot.

Doc from org.glassfish.gmbal.ManagedObjectManager.registerAtRoot.

Registers the MBean for obj at the root MBean for the ObjectManager, using the given name. Exactly the same as mom.register( mom.getRoot(), obj, name ).

Must be called after a successful createRoot call.

This version of register should not be used to register singletons.

registerAtRootback to summary
public GmbalMBean registerAtRoot(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.registerAtRoot.

Doc from org.glassfish.gmbal.ManagedObjectManager.registerAtRoot.

Same as registerAtRoot( Object, String ), but here the name is derived from an @ObjectKeyName annotation. Exactly the same as mom.register( mom.getRoot(), obj ).

This version of register should also be used to register singletons.

resumeJMXRegistrationback to summary
public void resumeJMXRegistration()

Implements org.glassfish.gmbal.ManagedObjectManager.resumeJMXRegistration.

Doc from org.glassfish.gmbal.ManagedObjectManager.resumeJMXRegistration.

Decrements the suspend counter, if the counter is greater than 0. When the counter goes to zero, it causes all MBeans created since a previous call to suspendJMXRegistration incremented the counter from 0 to 1 to be registered with the JMX MBeanServer. After this call, all new MBean registration calls to the JMX MBeanServer happen within the register call. May be called at any time.

setJMXRegistrationDebugback to summary
public void setJMXRegistrationDebug(boolean flag)

Implements org.glassfish.gmbal.ManagedObjectManager.setJMXRegistrationDebug.

Doc from org.glassfish.gmbal.ManagedObjectManager.setJMXRegistrationDebug.

Set debugging for JMX registrations. If true, all registrations and deregistrations with the MBeanServer are traced.

setMBeanServerback to summary
public void setMBeanServer(MBeanServer server)

Implements org.glassfish.gmbal.ManagedObjectManager.setMBeanServer.

Doc from org.glassfish.gmbal.ManagedObjectManager.setMBeanServer.

Set the MBeanServer to which all MBeans using this interface are published. The default value is java.lang.management.ManagementFactory.getPlatformMBeanServer().

Must be called before a successful createRoot call.

setRegistrationDebugback to summary
public void setRegistrationDebug(ManagedObjectManager.RegistrationDebugLevel level)

Implements org.glassfish.gmbal.ManagedObjectManager.setRegistrationDebug.

Doc from org.glassfish.gmbal.ManagedObjectManager.setRegistrationDebug.

Print debug output to System.out.

May be called at any time.

setResourceBundleback to summary
public void setResourceBundle(ResourceBundle rb)

Implements org.glassfish.gmbal.ManagedObjectManager.setResourceBundle.

Doc from org.glassfish.gmbal.ManagedObjectManager.setResourceBundle.

Set the ResourceBundle to use for getting localized descriptions. If not set, the description is the value in the annotation.

Must be called before a successful call to a createRoot method.

setRuntimeDebugback to summary
public void setRuntimeDebug(boolean flag)

Implements org.glassfish.gmbal.ManagedObjectManager.setRuntimeDebug.

Doc from org.glassfish.gmbal.ManagedObjectManager.setRuntimeDebug.

Enable generation of debug log at INFO level for runtime MBean operations to the org.glassfish.gmbal.impl logger.

May be called at any time.

setTypelibDebugback to summary
public void setTypelibDebug(int level)

Implements org.glassfish.gmbal.ManagedObjectManager.setTypelibDebug.

Doc from org.glassfish.gmbal.ManagedObjectManager.setTypelibDebug.

Enabled generation of debug log for type evaluator debugging. This happens as part of the registration process for the first time a particular class is processed.

May be called at any time.

stripPackagePrefixback to summary
public void stripPackagePrefix()

Implements org.glassfish.gmbal.ManagedObjectManager.stripPackagePrefix.

Doc from org.glassfish.gmbal.ManagedObjectManager.stripPackagePrefix.

Change the default type name algorithm so that if nothing else applies, the entire package prefix is stripped form the Class name. Otherwise, the full Class name is the type.

stripPrefixback to summary
public void stripPrefix(String... str)

Implements org.glassfish.gmbal.ManagedObjectManager.stripPrefix.

Doc from org.glassfish.gmbal.ManagedObjectManager.stripPrefix.

Add a type prefix to strip from type names, to shorten the names for a better presentation to the user. This may only be called before a createRot method is called.

suppressDuplicateRootReportback to summary
public void suppressDuplicateRootReport(boolean suppressReport)

Implements org.glassfish.gmbal.ManagedObjectManager.suppressDuplicateRootReport.

Doc from org.glassfish.gmbal.ManagedObjectManager.suppressDuplicateRootReport.

Suppress reporting of a duplicate root name. If this option is enabled, createRoot( Object ) and createRoot( Object, String ) will return null for a duplicate root name, otherwise a Gmbal error will be reported. Note that this applies ONLY to createRoot: the register methods are unaffected. Also note that any other errors that might occur on createRoot will be reported normally.

Must be called before a successful call to a createRoot method.

suspendJMXRegistrationback to summary
public void suspendJMXRegistration()

Implements org.glassfish.gmbal.ManagedObjectManager.suspendJMXRegistration.

Doc from org.glassfish.gmbal.ManagedObjectManager.suspendJMXRegistration.

If called, no MBeans created after this call will be registered with the JMX MBeanServer until resumeJMXRegistration is called. Each call increments a counter, so that nested and overlapping calls from multiple threads work correctly. May be called at any time.

unregisterback to summary
public void unregister(Object obj)

Implements org.glassfish.gmbal.ManagedObjectManager.unregister.

Doc from org.glassfish.gmbal.ManagedObjectManager.unregister.

Unregister the Open MBean corresponding to obj from the mbean server.

Must be called after a successful createRoot call.