com.j256.simplejmx.common
Annotation Type JmxResource


@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface JmxResource

This is used to identify an object which is going to be exported using JMX. Objects that are passed to JmxServer.register(Object) must either have this annotation, must implement JmxSelfNaming, or must be defined programmatically with JmxResourceInfo. This class is similar to Spring's @ManagedResource.

Author:
graywatson

Optional Element Summary
 String beanName
          Name of the JMX bean in the jconsole folder it is in.
 String description
          Description of the class for jconsole.
 String domainName
          Domain name of the object which turns into the top-level folder inside of jconsole.
 String[] folderNames
          Optional array of strings which translate into sub-folders below the domain-name that was specified above.
 

domainName

public abstract String domainName
Domain name of the object which turns into the top-level folder inside of jconsole.

If the object implements JmxSelfNaming then this would be replaced by JmxSelfNaming.getJmxDomainName(). If the object doesn't implement JmxSelfNaming and this is not specified then an exception is thrown.

Default:
""

beanName

public abstract String beanName
Name of the JMX bean in the jconsole folder it is in.

If the object implements JmxSelfNaming then this would be replaced by JmxSelfNaming.getJmxBeanName(). If the object doesn't implement JmxSelfNaming and this is not specified then the object class name is used.

Default:
""

folderNames

public abstract String[] folderNames
Optional array of strings which translate into sub-folders below the domain-name that was specified above. Default is for the object to show up in the domain-name folder. The folder names can either be in name=value format in which case they should be in alphabetic order by name. They can also just be in value format in which case a ## prefix (ex. 00=...) will be added by the code.

The following are basically synonymous:

 fieldValues = { "Database", "Connections" })
 fieldValues = { "00=Database", "01=Connections" })
 

If the object implements JmxSelfNaming then this would be replaced by JmxSelfNaming.getJmxFolderNames(). If the object doesn't implement JmxSelfNaming and this is not specified then this bean will be at the top without any sub-folders.

Default:
{}

description

public abstract String description
Description of the class for jconsole. Default is something like: "Information about class-name".

Default:
""


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.