|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glassfish.gmbal.impl.ManagedObjectManagerImpl
Nested Class Summary | |
---|---|
static interface |
ManagedObjectManagerImpl.DummyAverageRangeStatistic
|
static interface |
ManagedObjectManagerImpl.DummyBoundaryStatistic
|
static interface |
ManagedObjectManagerImpl.DummyBoundedRangeStatistic
|
static interface |
ManagedObjectManagerImpl.DummyCountStatistic
|
static interface |
ManagedObjectManagerImpl.DummyRangeStatistic
|
static interface |
ManagedObjectManagerImpl.DummyStatistic
|
static interface |
ManagedObjectManagerImpl.DummyStringStatistic
|
static interface |
ManagedObjectManagerImpl.DummyTimeStatistic
|
Nested classes/interfaces inherited from interface org.glassfish.gmbal.impl.ManagedObjectManagerInternal |
---|
ManagedObjectManagerInternal.AttributeDescriptorType |
Nested classes/interfaces inherited from interface org.glassfish.gmbal.ManagedObjectManager |
---|
ManagedObjectManager.RegistrationDebugLevel |
Constructor Summary | |
---|---|
ManagedObjectManagerImpl(javax.management.ObjectName rootParentName)
|
|
ManagedObjectManagerImpl(java.lang.String domain)
|
Method Summary | ||
---|---|---|
void |
addAnnotation(java.lang.reflect.AnnotatedElement element,
java.lang.annotation.Annotation annotation)
Method to add an annotation to an element that cannot be modified. |
|
void |
addInheritedAnnotations(java.lang.Class<?> cls)
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). |
|
void |
close()
|
|
MBeanImpl |
constructMBean(MBeanImpl parentEntity,
java.lang.Object obj,
java.lang.String name)
|
|
GmbalMBean |
createRoot()
Create a default root MBean. |
|
GmbalMBean |
createRoot(java.lang.Object root)
Create a root MBean from root, which much have a method with the |
|
GmbalMBean |
createRoot(java.lang.Object root,
java.lang.String name)
Create a root MBean from root with the given name. |
|
java.lang.String |
dumpSkeleton(java.lang.Object obj)
Dump the skeleton used in the implementation of the MBean for obj. |
|
|
forAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.Class<T> cls)
|
|
AMXClient |
getAMXClient(java.lang.Object obj)
Get an AMXClient instance for the object obj, if obj is registered as an MBean in this mom. |
|
|
getAnnotation(java.lang.reflect.AnnotatedElement element,
java.lang.Class<T> type)
|
|
java.util.Collection<java.lang.annotation.Annotation> |
getAnnotations(java.lang.reflect.AnnotatedElement elem)
|
|
|
getAttributes(EvaluatedClassAnalyzer ca,
ManagedObjectManagerInternal.AttributeDescriptorType adt)
|
|
|
getClassAnalyzer(EvaluatedClassDeclaration cls,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Find the superclass or superinterface of cls (which may be cls itself) that has the given annotationClass as an annotation. |
|
AMXMetadata |
getDefaultAMXMetadata()
|
|
java.lang.String |
getDescription(EvaluatedDeclaration element)
|
|
java.lang.String |
getDomain()
Return the domain name that was used when this ManagedObjectManager was created. |
|
FacetAccessor |
getFacetAccessor(java.lang.Object obj)
|
|
|
getFirstAnnotationOnClass(EvaluatedClassDeclaration element,
java.lang.Class<T> type)
|
|
java.util.List<InheritedAttribute> |
getInheritedAttributes(EvaluatedClassAnalyzer ca)
Get the inherited attributes from the EvaluatedClassAnalyzer. |
|
javax.management.MBeanServer |
getMBeanServer()
Get the current MBeanServer. |
|
java.lang.Object |
getObject(javax.management.ObjectName oname)
Get the Object that was registered with the given ObjectName. |
|
javax.management.ObjectName |
getObjectName(java.lang.Object obj)
Get the ObjectName for the given object (which must have been registered via a register call). |
|
ObjectRegistrationManager |
getObjectRegistrationManager()
Return an ObjectRegistrationManager as required in the pfl timer services. |
|
java.util.ResourceBundle |
getResourceBundle()
Get the resource bundle (if any) set by setResourceBundle. |
|
java.lang.Object |
getRoot()
Return the root of this ManagedObjectManager. |
|
javax.management.ObjectName |
getRootParentName()
|
|
TypeConverter |
getTypeConverter(EvaluatedType type)
Construct or lookup the TypeConverter for the given type. |
|
java.lang.String |
getTypeName(java.lang.Class<?> cls,
java.lang.String fieldName,
java.lang.String nameFromAnnotation)
|
|
boolean |
isAMXAttributeName(java.lang.String name)
|
|
boolean |
isManagedObject(java.lang.Object obj)
Return true if object is assignment compatible with a class or interface that has an @ManagedObject annotation, otherwise false. |
|
boolean |
jmxRegistrationDebug()
|
|
|
putIfNotPresent(java.util.Map<K,V> map,
K key,
V value)
|
|
GmbalMBean |
register(java.lang.Object parent,
java.lang.Object obj)
Same as register( parent, obj, name ), but here the name is derived from an @NameValue annotation. |
|
GmbalMBean |
register(java.lang.Object parent,
java.lang.Object obj,
java.lang.String name)
Construct an Open Mean for obj according to its annotations, and register it with domain getDomain() and the appropriate ObjectName. |
|
GmbalMBean |
registerAtRoot(java.lang.Object obj)
Same as registerAtRoot( Object, String ), but here the name is derived from an @ObjectKeyName annotation. |
|
GmbalMBean |
registerAtRoot(java.lang.Object obj,
java.lang.String name)
Registers the MBean for obj at the root MBean for the ObjectManager, using the given name. |
|
boolean |
registrationDebug()
|
|
boolean |
registrationFineDebug()
|
|
void |
resumeJMXRegistration()
Decrements the suspend counter, if the counter is greater than 0. |
|
boolean |
runtimeDebug()
|
|
void |
setJMXRegistrationDebug(boolean flag)
Set debugging for JMX registrations. |
|
void |
setMBeanServer(javax.management.MBeanServer server)
Set the MBeanServer to which all MBeans using this interface are published. |
|
void |
setRegistrationDebug(ManagedObjectManager.RegistrationDebugLevel level)
Print debug output to System.out. |
|
void |
setResourceBundle(java.util.ResourceBundle rb)
Set the ResourceBundle to use for getting localized descriptions. |
|
void |
setRuntimeDebug(boolean flag)
Enable generation of debug log at INFO level for runtime MBean operations to the org.glassfish.gmbal.impl logger. |
|
void |
setTypelibDebug(int level)
Enabled generation of debug log for type evaluator debugging. |
|
void |
stripPackagePrefix()
Change the default type name algorithm so that if nothing else applies, the entire package prefix is stripped form the Class name. |
|
void |
stripPrefix(java.lang.String... args)
Add a type prefix to strip from type names, to shorten the names for a better presentation to the user. |
|
void |
suppressDuplicateRootReport(boolean suppressReport)
Suppress reporting of a duplicate root name. |
|
void |
suspendJMXRegistration()
If called, no MBeans created after this call will be registered with the JMX MBeanServer until resumeJMXRegistration is called. |
|
java.lang.String |
toString()
|
|
void |
unregister(java.lang.Object obj)
Unregister the Open MBean corresponding to obj from the mbean server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ManagedObjectManagerImpl(java.lang.String domain)
public ManagedObjectManagerImpl(javax.management.ObjectName rootParentName)
Method Detail |
---|
close
in interface java.io.Closeable
java.io.IOException
public void suspendJMXRegistration()
ManagedObjectManager
suspendJMXRegistration
in interface ManagedObjectManager
public void resumeJMXRegistration()
ManagedObjectManager
resumeJMXRegistration
in interface ManagedObjectManager
public void stripPackagePrefix()
ManagedObjectManager
stripPackagePrefix
in interface ManagedObjectManager
public java.lang.String toString()
toString
in class java.lang.Object
public javax.management.ObjectName getRootParentName()
getRootParentName
in interface ManagedObjectManagerInternal
public GmbalMBean createRoot()
ManagedObjectManager
createRoot
in interface ManagedObjectManager
public GmbalMBean createRoot(java.lang.Object root)
ManagedObjectManager
createRoot
in interface ManagedObjectManager
root
- The Java object to be used to construct the root.
public GmbalMBean createRoot(java.lang.Object root, java.lang.String name)
ManagedObjectManager
createRoot
in interface ManagedObjectManager
root
- The Java object to be used to construct the root.name
- The ObjectName name field to be used in the ObjectName of
the MBean constructed from root.
public java.lang.Object getRoot()
ManagedObjectManager
getRoot
in interface ManagedObjectManager
ManagedObjectManagerInternal
getTypeConverter
in interface ManagedObjectManagerInternal
type
- The type for which we need a TypeConverter.
public java.lang.String getTypeName(java.lang.Class<?> cls, java.lang.String fieldName, java.lang.String nameFromAnnotation)
getTypeName
in interface ManagedObjectManagerInternal
public boolean isManagedObject(java.lang.Object obj)
ManagedObjectManager
isManagedObject
in interface ManagedObjectManager
constructMBean
in interface ManagedObjectManagerInternal
ManagedObjectManager
The MBeanInfo for the result is actually ModelMBeanInfo, and may contain extra metadata as defined using annotations defined with the
register
in interface ManagedObjectManager
parent
- The parent object that contains obj.obj
- The managed object we are registering.name
- The name to use for registering this object.
public GmbalMBean register(java.lang.Object parent, java.lang.Object obj)
ManagedObjectManager
This version of register should also be used to register singletons.
register
in interface ManagedObjectManager
parent
- The parent object that contains obj.obj
- The managed object we are registering.
public GmbalMBean registerAtRoot(java.lang.Object obj, java.lang.String name)
ManagedObjectManager
Must be called after a successful createRoot call.
This version of register should not be used to register singletons.
registerAtRoot
in interface ManagedObjectManager
obj
- The object for which we construct and register an MBean.name
- The name of the MBean.
public GmbalMBean registerAtRoot(java.lang.Object obj)
ManagedObjectManager
This version of register should also be used to register singletons.
registerAtRoot
in interface ManagedObjectManager
obj
- The managed object we are registering.
ManagedObjectManager
Must be called after a successful createRoot call.
unregister
in interface ManagedObjectManager
obj
- The object originally passed to a register method.ManagedObjectManager
Must be called after a successful createRoot call.
getObjectName
in interface ManagedObjectManager
obj
- The object originally passed to a register call.
public AMXClient getAMXClient(java.lang.Object obj)
ManagedObjectManager
Must be called after a successful createRoot call.
getAMXClient
in interface ManagedObjectManager
obj
- The object corresponding to an MBean.
ManagedObjectManager
Must be called after a successful createRoot call.
getObject
in interface ManagedObjectManager
oname
- The ObjectName used to register the object.
public FacetAccessor getFacetAccessor(java.lang.Object obj)
getFacetAccessor
in interface ManagedObjectManagerInternal
public java.lang.String getDomain()
ManagedObjectManager
May be called at any time.
getDomain
in interface ManagedObjectManager
public void setMBeanServer(javax.management.MBeanServer server)
ManagedObjectManager
Must be called before a successful createRoot call.
setMBeanServer
in interface ManagedObjectManager
server
- The MBeanServer to set as the MBeanServer for this
ManagedObjectManager.public javax.management.MBeanServer getMBeanServer()
ManagedObjectManager
May be called at any time.
getMBeanServer
in interface ManagedObjectManager
public void setResourceBundle(java.util.ResourceBundle rb)
ManagedObjectManager
Must be called before a successful call to a createRoot method.
setResourceBundle
in interface ManagedObjectManager
rb
- The resource bundle to use. May be null.public java.util.ResourceBundle getResourceBundle()
ManagedObjectManager
May be called at any time.
getResourceBundle
in interface ManagedObjectManager
public java.lang.String getDescription(EvaluatedDeclaration element)
getDescription
in interface ManagedObjectManagerInternal
ManagedObjectManager
addAnnotation
in interface ManagedObjectManager
element
- The annotated element (class or method for our purposes).annotation
- The annotation we wish to add to the element.ManagedObjectManager
addInheritedAnnotations
in interface ManagedObjectManager
cls
- Class to analyze for inherited annotations.public <T extends java.lang.annotation.Annotation> T getFirstAnnotationOnClass(EvaluatedClassDeclaration element, java.lang.Class<T> type)
getFirstAnnotationOnClass
in interface ManagedObjectManagerInternal
getAnnotation
in interface ManagedObjectManagerInternal
getAnnotations
in interface ManagedObjectManagerInternal
ManagedObjectManagerInternal
getClassAnalyzer
in interface ManagedObjectManagerInternal
cls
- The class for which we need a EvaluatedClassAnalyzer.annotationClass
- The annotation that must be present on cls or
a superclass or superinterface.
ManagedObjectManagerInternal
getInheritedAttributes
in interface ManagedObjectManagerInternal
ca
- The ClassAnalyzer to check for InheritedAttribute(s).
putIfNotPresent
in interface ManagedObjectManagerInternal
publicgetAttributes(EvaluatedClassAnalyzer ca, ManagedObjectManagerInternal.AttributeDescriptorType adt)
getAttributes
in interface ManagedObjectManagerInternal
public void setRegistrationDebug(ManagedObjectManager.RegistrationDebugLevel level)
ManagedObjectManager
May be called at any time.
setRegistrationDebug
in interface ManagedObjectManager
level
- NONE is no debugging at all, NORMAL traces high-level
construction of skeletons and type converters, and dumps results of new
skeletons and type converters, FINE traces everything in great detail.
The tracing is done with INFO-level logger calls. The logger name is
that package name (org.glassfish.gmbal.impl).public void setJMXRegistrationDebug(boolean flag)
ManagedObjectManager
setJMXRegistrationDebug
in interface ManagedObjectManager
flag
- True to enalbed registration tracing.public void setRuntimeDebug(boolean flag)
ManagedObjectManager
May be called at any time.
setRuntimeDebug
in interface ManagedObjectManager
flag
- true to enable runtime debug, false to disable.public void setTypelibDebug(int level)
ManagedObjectManager
May be called at any time.
setTypelibDebug
in interface ManagedObjectManager
level
- set to 1 to just see the results of the TypeEvaluator, >1 to
see lots of details. WARNING: values >1 will result in a large amount
of output.public java.lang.String dumpSkeleton(java.lang.Object obj)
ManagedObjectManager
Must be called after a successful call to a createRoot method.
dumpSkeleton
in interface ManagedObjectManager
obj
- The registered object whose skeleton should be displayed.
public boolean registrationDebug()
registrationDebug
in interface ManagedObjectManagerInternal
public boolean registrationFineDebug()
registrationFineDebug
in interface ManagedObjectManagerInternal
public boolean runtimeDebug()
runtimeDebug
in interface ManagedObjectManagerInternal
public boolean jmxRegistrationDebug()
jmxRegistrationDebug
in interface ManagedObjectManagerInternal
public void stripPrefix(java.lang.String... args)
ManagedObjectManager
stripPrefix
in interface ManagedObjectManager
args
- Class package name to strip from type name.public <T extends EvaluatedDeclaration>forAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.Class<T> cls)
forAnnotation
in interface ManagedObjectManagerInternal
public AMXMetadata getDefaultAMXMetadata()
getDefaultAMXMetadata
in interface ManagedObjectManagerInternal
public boolean isAMXAttributeName(java.lang.String name)
isAMXAttributeName
in interface ManagedObjectManagerInternal
public void suppressDuplicateRootReport(boolean suppressReport)
ManagedObjectManager
Must be called before a successful call to a createRoot method.
suppressDuplicateRootReport
in interface ManagedObjectManager
public ObjectRegistrationManager getObjectRegistrationManager()
ManagedObjectManager
Can be called at any time.
getObjectRegistrationManager
in interface ManagedObjectManager
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |