|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.gmbal.impl.ManagedObjectManagerImpl
public class 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(ObjectName rootParentName)
|
|
ManagedObjectManagerImpl(String domain)
|
|
| Method Summary | ||
|---|---|---|
void |
addAnnotation(AnnotatedElement element,
Annotation annotation)
Method to add an annotation to an element that cannot be modified. |
|
void |
close()
|
|
MBeanImpl |
constructMBean(MBeanImpl parentEntity,
Object obj,
String name)
|
|
GmbalMBean |
createRoot()
Create a default root MBean. |
|
GmbalMBean |
createRoot(Object root)
Create a root MBean from root, which much have a method with the |
|
GmbalMBean |
createRoot(Object root,
String name)
Create a root MBean from root with the given name. |
|
String |
dumpSkeleton(Object obj)
Dump the skeleton used in the implementation of the MBean for obj. |
|
|
forAnnotation(Class<? extends Annotation> annotation,
Class<T> cls)
|
|
AMXClient |
getAMXClient(Object obj)
Get an AMXClient instance for the object obj, if obj is registered as an MBean in this mom. |
|
|
getAnnotation(AnnotatedElement element,
Class<T> type)
|
|
Collection<Annotation> |
getAnnotations(AnnotatedElement elem)
|
|
Pair<Map<String,AttributeDescriptor>,Map<String,AttributeDescriptor>> |
getAttributes(EvaluatedClassAnalyzer ca,
ManagedObjectManagerInternal.AttributeDescriptorType adt)
|
|
Pair<EvaluatedClassDeclaration,EvaluatedClassAnalyzer> |
getClassAnalyzer(EvaluatedClassDeclaration cls,
Class<? extends Annotation> annotationClass)
Find the superclass or superinterface of cls (which may be cls itself) that has the given annotationClass as an annotation. |
|
AMXMetadata |
getDefaultAMXMetadata()
|
|
String |
getDescription(EvaluatedDeclaration element)
|
|
String |
getDomain()
Return the domain name that was used when this ManagedObjectManager was created. |
|
FacetAccessor |
getFacetAccessor(Object obj)
|
|
|
getFirstAnnotationOnClass(EvaluatedClassDeclaration element,
Class<T> type)
|
|
List<InheritedAttribute> |
getInheritedAttributes(EvaluatedClassAnalyzer ca)
Get the inherited attributes from the EvaluatedClassAnalyzer. |
|
MBeanServer |
getMBeanServer()
Get the current MBeanServer. |
|
Object |
getObject(ObjectName oname)
Get the Object that was registered with the given ObjectName. |
|
ObjectName |
getObjectName(Object obj)
Get the ObjectName for the given object (which must have been registered via a register call). |
|
ResourceBundle |
getResourceBundle()
Get the resource bundle (if any) set by setResourceBundle. |
|
Object |
getRoot()
Return the root of this ManagedObjectManager. |
|
ObjectName |
getRootParentName()
|
|
TypeConverter |
getTypeConverter(EvaluatedType type)
Construct or lookup the TypeConverter for the given type. |
|
String |
getTypeName(Class<?> cls,
String fieldName,
String nameFromAnnotation)
|
|
boolean |
isAMXAttributeName(String name)
|
|
boolean |
isManagedObject(Object obj)
Return true if object is assignment compatible with a class or interface that has an @ManagedObject annotation, otherwise false. |
|
boolean |
jmxRegistrationDebug()
|
|
|
putIfNotPresent(Map<K,V> map,
K key,
V value)
|
|
GmbalMBean |
register(Object parent,
Object obj)
Same as register( parent, obj, name ), but here the name is derived from an @NameValue annotation. |
|
GmbalMBean |
register(Object parent,
Object obj,
String name)
Construct an Open Mean for obj according to its annotations, and register it with domain getDomain() and the appropriate ObjectName. |
|
GmbalMBean |
registerAtRoot(Object obj)
Same as registerAtRoot( Object, String ), but here the name is derived from an @ObjectKeyName annotation. |
|
GmbalMBean |
registerAtRoot(Object obj,
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(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(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(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. |
|
String |
toString()
|
|
void |
unregister(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(String domain)
public ManagedObjectManagerImpl(ObjectName rootParentName)
| Method Detail |
|---|
public void close()
throws IOException
close in interface CloseableIOExceptionpublic void suspendJMXRegistration()
ManagedObjectManager
suspendJMXRegistration in interface ManagedObjectManagerpublic void resumeJMXRegistration()
ManagedObjectManager
resumeJMXRegistration in interface ManagedObjectManagerpublic void stripPackagePrefix()
ManagedObjectManager
stripPackagePrefix in interface ManagedObjectManagerpublic String toString()
toString in class Objectpublic ObjectName getRootParentName()
getRootParentName in interface ManagedObjectManagerInternalpublic GmbalMBean createRoot()
ManagedObjectManager
createRoot in interface ManagedObjectManagerpublic GmbalMBean createRoot(Object root)
ManagedObjectManager
createRoot in interface ManagedObjectManagerroot - The Java object to be used to construct the root.
public GmbalMBean createRoot(Object root,
String name)
ManagedObjectManager
createRoot in interface ManagedObjectManagerroot - 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 Object getRoot()
ManagedObjectManager
getRoot in interface ManagedObjectManagerpublic TypeConverter getTypeConverter(EvaluatedType type)
ManagedObjectManagerInternal
getTypeConverter in interface ManagedObjectManagerInternaltype - The type for which we need a TypeConverter.
public String getTypeName(Class<?> cls,
String fieldName,
String nameFromAnnotation)
getTypeName in interface ManagedObjectManagerInternalpublic boolean isManagedObject(Object obj)
ManagedObjectManager
isManagedObject in interface ManagedObjectManager
public MBeanImpl constructMBean(MBeanImpl parentEntity,
Object obj,
String name)
constructMBean in interface ManagedObjectManagerInternal
public GmbalMBean register(Object parent,
Object obj,
String name)
ManagedObjectManagerThe MBeanInfo for the result is actually ModelMBeanInfo, and may contain extra metadata as defined using annotations defined with the
register in interface ManagedObjectManagerparent - 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(Object parent,
Object obj)
ManagedObjectManagerThis version of register should also be used to register singletons.
register in interface ManagedObjectManagerparent - The parent object that contains obj.obj - The managed object we are registering.
public GmbalMBean registerAtRoot(Object obj,
String name)
ManagedObjectManagerMust be called after a successful createRoot call.
This version of register should not be used to register singletons.
registerAtRoot in interface ManagedObjectManagerobj - The object for which we construct and register an MBean.name - The name of the MBean.
public GmbalMBean registerAtRoot(Object obj)
ManagedObjectManagerThis version of register should also be used to register singletons.
registerAtRoot in interface ManagedObjectManagerobj - The managed object we are registering.
public void unregister(Object obj)
ManagedObjectManagerMust be called after a successful createRoot call.
unregister in interface ManagedObjectManagerobj - The object originally passed to a register method.public ObjectName getObjectName(Object obj)
ManagedObjectManagerMust be called after a successful createRoot call.
getObjectName in interface ManagedObjectManagerobj - The object originally passed to a register call.
public AMXClient getAMXClient(Object obj)
ManagedObjectManagerMust be called after a successful createRoot call.
getAMXClient in interface ManagedObjectManagerobj - The object corresponding to an MBean.
public Object getObject(ObjectName oname)
ManagedObjectManagerMust be called after a successful createRoot call.
getObject in interface ManagedObjectManageroname - The ObjectName used to register the object.
public FacetAccessor getFacetAccessor(Object obj)
getFacetAccessor in interface ManagedObjectManagerInternalpublic String getDomain()
ManagedObjectManagerMay be called at any time.
getDomain in interface ManagedObjectManagerpublic void setMBeanServer(MBeanServer server)
ManagedObjectManagerMust be called before a successful createRoot call.
setMBeanServer in interface ManagedObjectManagerserver - The MBeanServer to set as the MBeanServer for this
ManagedObjectManager.public MBeanServer getMBeanServer()
ManagedObjectManagerMay be called at any time.
getMBeanServer in interface ManagedObjectManagerpublic void setResourceBundle(ResourceBundle rb)
ManagedObjectManagerMust be called before a successful call to a createRoot method.
setResourceBundle in interface ManagedObjectManagerrb - The resource bundle to use. May be null.public ResourceBundle getResourceBundle()
ManagedObjectManagerMay be called at any time.
getResourceBundle in interface ManagedObjectManagerpublic String getDescription(EvaluatedDeclaration element)
getDescription in interface ManagedObjectManagerInternal
public void addAnnotation(AnnotatedElement element,
Annotation annotation)
ManagedObjectManager
addAnnotation in interface ManagedObjectManagerelement - The annotated element (class or method for our purposes).annotation - The annotation we wish to add to the element.
public <T extends Annotation> T getFirstAnnotationOnClass(EvaluatedClassDeclaration element,
Class<T> type)
getFirstAnnotationOnClass in interface ManagedObjectManagerInternal
public <T extends Annotation> T getAnnotation(AnnotatedElement element,
Class<T> type)
getAnnotation in interface ManagedObjectManagerInternalpublic Collection<Annotation> getAnnotations(AnnotatedElement elem)
getAnnotations in interface ManagedObjectManagerInternal
public Pair<EvaluatedClassDeclaration,EvaluatedClassAnalyzer> getClassAnalyzer(EvaluatedClassDeclaration cls,
Class<? extends Annotation> annotationClass)
ManagedObjectManagerInternal
getClassAnalyzer in interface ManagedObjectManagerInternalcls - The class for which we need a EvaluatedClassAnalyzer.annotationClass - The annotation that must be present on cls or
a superclass or superinterface.
public List<InheritedAttribute> getInheritedAttributes(EvaluatedClassAnalyzer ca)
ManagedObjectManagerInternal
getInheritedAttributes in interface ManagedObjectManagerInternalca - The ClassAnalyzer to check for InheritedAttribute(s).
public <K,V> void putIfNotPresent(Map<K,V> map,
K key,
V value)
putIfNotPresent in interface ManagedObjectManagerInternal
public Pair<Map<String,AttributeDescriptor>,Map<String,AttributeDescriptor>> getAttributes(EvaluatedClassAnalyzer ca,
ManagedObjectManagerInternal.AttributeDescriptorType adt)
getAttributes in interface ManagedObjectManagerInternalpublic void setRegistrationDebug(ManagedObjectManager.RegistrationDebugLevel level)
ManagedObjectManagerMay be called at any time.
setRegistrationDebug in interface ManagedObjectManagerlevel - 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 ManagedObjectManagerflag - True to enalbed registration tracing.public void setRuntimeDebug(boolean flag)
ManagedObjectManagerMay be called at any time.
setRuntimeDebug in interface ManagedObjectManagerflag - true to enable runtime debug, false to disable.public void setTypelibDebug(int level)
ManagedObjectManagerMay be called at any time.
setTypelibDebug in interface ManagedObjectManagerlevel - 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 String dumpSkeleton(Object obj)
ManagedObjectManagerMust be called after a successful call to a createRoot method.
dumpSkeleton in interface ManagedObjectManagerobj - The registered object whose skeleton should be displayed.
public boolean registrationDebug()
registrationDebug in interface ManagedObjectManagerInternalpublic boolean registrationFineDebug()
registrationFineDebug in interface ManagedObjectManagerInternalpublic boolean runtimeDebug()
runtimeDebug in interface ManagedObjectManagerInternalpublic boolean jmxRegistrationDebug()
jmxRegistrationDebug in interface ManagedObjectManagerInternalpublic void stripPrefix(String... args)
ManagedObjectManager
stripPrefix in interface ManagedObjectManagerargs - Class package name to strip from type name.
public <T extends EvaluatedDeclaration> Predicate<T> forAnnotation(Class<? extends Annotation> annotation,
Class<T> cls)
forAnnotation in interface ManagedObjectManagerInternalpublic AMXMetadata getDefaultAMXMetadata()
getDefaultAMXMetadata in interface ManagedObjectManagerInternalpublic boolean isAMXAttributeName(String name)
isAMXAttributeName in interface ManagedObjectManagerInternalpublic void suppressDuplicateRootReport(boolean suppressReport)
ManagedObjectManagerMust be called before a successful call to a createRoot method.
suppressDuplicateRootReport in interface ManagedObjectManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||