This
- the type of this mediator.@Immutable public abstract class JmxMediator<This extends JmxMediator<This>> extends Mediator<This>
Constructor and Description |
---|
JmxMediator() |
Modifier and Type | Method and Description |
---|---|
<C extends JmxComponent> |
activate(C component)
Activates and returns the given
component . |
boolean |
deregister(ObjectName name)
Removes any MBean with the given object
name
in the configured MBean server. |
Package |
getDomain()
Returns the package object who's name should be used as the domain of
any object names to register.
|
MBeanServer |
getMBeanServer()
Returns the MBean server for registering the MBeans.
|
net.java.truecommons.jmx.ObjectNameBuilder |
nameBuilder(Class<?> type)
Returns a new object name builder.
|
boolean |
register(ObjectName name,
Object mbean)
|
instrument, instrument, instrument, instrument, instrument, instrument, instrument, instrument, instrument, instrument, instrument, instrument, instrument, instrument, instrument
public <C extends JmxComponent> C activate(C component)
component
.C
- the type of the component to activate.component
- the component to activate.public boolean deregister(ObjectName name)
name
in the configured MBean server.
The implementation in the class JmxMediator
logs error
messages at the warn and trace level when the deregistration fails with
an InstanceNotFoundException
.
name
- the object name.true
if any MBean has been successfully removed
with the given name
.
false
if no MBean was registered
with the given name
.IllegalArgumentException
- if removing an MBean failed with an
JMException
.public Package getDomain()
public MBeanServer getMBeanServer()
The implementation in the class JmxMediator
returns
MBeanServerLocator.SINGLETON.get()
.
public net.java.truecommons.jmx.ObjectNameBuilder nameBuilder(Class<?> type)
type
- the class identifying the type of the MBean who's name shall
get build.public boolean register(@CheckForNull ObjectName name, Object mbean)
name
to the given mbean
in the MBean server.
The implementation in the class JmxMediator
logs error
messages at the warn and trace level when the registration fails with
an InstanceAlreadyExistsException
.
name
- the object name.mbean
- the MBean.true
if the MBean has been successfully registered
with the given name
.
false
if any MBean was already registered
with the given name
.IllegalArgumentException
- if registering the MBean failed with an
JMException
.Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.