Class ObjectMBean
- java.lang.Object
-
- org.eclipse.jetty.jmx.ObjectMBean
-
- All Implemented Interfaces:
DynamicMBean
- Direct Known Subclasses:
AbstractConnectorMBean,AbstractHandlerMBean,FilterMappingMBean,HolderMBean,HttpClientMBean,ServerMBean,ServletMappingMBean
@Deprecated(since="2021-05-27") public class ObjectMBean extends Object implements DynamicMBean
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.A dynamic MBean that can wrap an arbitrary Object instance.
The attributes and operations exposed by this bean are controlled by the merge of annotations discovered in all superclasses and all superinterfaces.
Given class
com.acme.Foo, thencom.acme.jmx.FooMBeanis searched; if found, it is instantiated with thecom.acme.Fooinstance passed to the constructor.Class
com.acme.jmx.FooMBeancan then override the default behavior of ObjectMBean and provide a custom ObjectName, or custom ObjectName propertiesnameandcontext, etc.
-
-
Constructor Summary
Constructors Constructor Description ObjectMBean(Object managedObject)Deprecated.Creates a new ObjectMBean wrapping the givenmanagedObject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ObjectgetAttribute(String name)Deprecated.AttributeListgetAttributes(String[] names)Deprecated.ObjectgetManagedObject()Deprecated.MBeanContainergetMBeanContainer()Deprecated.MBeanInfogetMBeanInfo()Deprecated.StringgetObjectContextBasis()Deprecated.Allows to customize the ObjectName propertycontext.ObjectNamegetObjectName()Deprecated.Allows to customize the ObjectName of this MBean.StringgetObjectNameBasis()Deprecated.Allows to customize the ObjectName propertyname.Objectinvoke(String name, Object[] params, String[] signature)Deprecated.static ObjectmbeanFor(Object o)Deprecated.UseMBeanContainer.mbeanFor(Object)insteadvoidsetAttribute(Attribute attribute)Deprecated.AttributeListsetAttributes(AttributeList attributes)Deprecated.
-
-
-
Constructor Detail
-
ObjectMBean
public ObjectMBean(Object managedObject)
Deprecated.Creates a new ObjectMBean wrapping the givenmanagedObject.- Parameters:
managedObject- the object to manage
-
-
Method Detail
-
getManagedObject
public Object getManagedObject()
Deprecated.- Returns:
- the managed object
-
getObjectName
public ObjectName getObjectName()
Deprecated.Allows to customize the ObjectName of this MBean.
- Returns:
- a custom ObjectName, or null to indicate to
MBeanContainerto create a default ObjectName
-
getObjectContextBasis
public String getObjectContextBasis()
Deprecated.Allows to customize the ObjectName property
context.When
MBeanContainercreates default ObjectNames, thecontextproperty is "inherited" recursively by MBeans that are children of this MBean; this allows to "group" descendant MBeans so that it is clear who is the ancestor they belong to.For example, if object A has a child component B which has children components C, then AMBean can override this method to return "alpha", and then the ObjectNames will be:
- domain:type=a,context=alpha,id=0
- domain:type=b,context=alpha,id=0
- domain:type=c,context=alpha,id=0
- domain:type=c,context=alpha,id=1
- Returns:
- a custom value for the property
context
-
getObjectNameBasis
public String getObjectNameBasis()
Deprecated.Allows to customize the ObjectName property
name.Certain components have a natural name and returning it from this method allows it to be part of the ObjectName.
- Returns:
- a custom value for the property
name
-
getMBeanContainer
public MBeanContainer getMBeanContainer()
Deprecated.
-
mbeanFor
@Deprecated public static Object mbeanFor(Object o)
Deprecated.UseMBeanContainer.mbeanFor(Object)instead- Parameters:
o- the object to wrap as MBean- Returns:
- a new instance of an MBean for the object or null if the MBean cannot be created
-
getMBeanInfo
public MBeanInfo getMBeanInfo()
Deprecated.- Specified by:
getMBeanInfoin interfaceDynamicMBean
-
getAttribute
public Object getAttribute(String name) throws AttributeNotFoundException, ReflectionException, MBeanException
Deprecated.- Specified by:
getAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionReflectionExceptionMBeanException
-
getAttributes
public AttributeList getAttributes(String[] names)
Deprecated.- Specified by:
getAttributesin interfaceDynamicMBean
-
setAttribute
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, ReflectionException, MBeanException
Deprecated.- Specified by:
setAttributein interfaceDynamicMBean- Throws:
AttributeNotFoundExceptionReflectionExceptionMBeanException
-
setAttributes
public AttributeList setAttributes(AttributeList attributes)
Deprecated.- Specified by:
setAttributesin interfaceDynamicMBean
-
invoke
public Object invoke(String name, Object[] params, String[] signature) throws ReflectionException, MBeanException
Deprecated.- Specified by:
invokein interfaceDynamicMBean- Throws:
ReflectionExceptionMBeanException
-
-