I
- The Type of Object to expose as an MBean. Currently only used with SingleMBeanObject
public class SingleMBeanObject<I> extends Object
The register method will register a given object under an object name, generated with the domain given in constructor, and fields from the Hashtable nameProperties. It is prefilled with values common for all MBeans, but it is expected to be extended after the object is created with additional info.
Constructor and Description |
---|
SingleMBeanObject(ObjectName name,
I o,
Class<I> asInterface,
MBeanServer mBeanServer)
Create a single mbean object.
|
SingleMBeanObject(String domain,
I object,
Class<I> asInterface,
MBeanServer mBeanServer)
Create a single mbean object.
|
Modifier and Type | Method and Description |
---|---|
ObjectName |
getName() |
Hashtable<String,String> |
getNameProperties()
Properties for the ObjectName name.
|
void |
register()
Registers this object as a standard MBean, with a name generated from domain given in constructor and the
nameProperties hashTable.
|
void |
unregister()
Unregister the object from the MBeanServer.
|
public SingleMBeanObject(String domain, I object, Class<I> asInterface, MBeanServer mBeanServer)
domain
- The domain of the MBean.object
- The object to expose as an MBean.asInterface
- The interface this MBean is exposed as.mBeanServer
- The server to register the mbean in.ArgumentNotValid
- If domain is null or empty, or any other argument is null.public SingleMBeanObject(ObjectName name, I o, Class<I> asInterface, MBeanServer mBeanServer)
This is a helper method for the constructor taking a domain, which take the domain from a preconstructed ObjectName and replaces the nameProperties with the properties from the given object name. Use this if you have an object name created already, which you wish to use.
name
- The object name to register under.o
- The object to register.asInterface
- The interface o should implement.mBeanServer
- The mbean server to register o in.ArgumentNotValid
- on any null parameter.public Hashtable<String,String> getNameProperties()
public void register()
IllegalState
- if bean is already registered.IOFailure
- on trouble registering.public void unregister() throws IOFailure
IOFailure
- on trouble unregistering.public ObjectName getName()
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.