Package com.tangosol.net.management
Class WrapperMBeanServerProxy
java.lang.Object
com.tangosol.net.management.WrapperMBeanServerProxy
- All Implemented Interfaces:
MBeanServerProxy
A
MBeanServerProxy
that wraps a MBeanServer
.- Author:
- jk 2019.05.30
-
Constructor Summary
ConstructorDescriptionWrapperMBeanServerProxy
(Supplier<MBeanServer> supplier) Create aWrapperMBeanServerProxy
.WrapperMBeanServerProxy
(MBeanServer server) Create aWrapperMBeanServerProxy
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNotificationListener
(String sName, NotificationListener listener, NotificationFilter filter, Object oHandback) Adds a listener to a registered MBean.<R> R
execute
(Remote.Function<MBeanServer, R> function) Afunction
executed on the management node.getAttribute
(String sName, String sAttr) Obtain the value of the specified MBean attribute.getAttributes
(String sName, Filter<String> filter) Return a Map of attribute name to attribute value for a given MBean name.getMBeanInfo
(String sName) Return the MBeanInfo for a given MBean.Invoke an operation on the specified MBean.boolean
isMBeanRegistered
(String sName) Check whether or not an MBean with the specified name is already registered.local()
Return a local onlyMBeanServerProxy
.queryNames
(String sPattern, Filter<ObjectName> filter) Get the names of MBeans controlled by the MBean server that is collocated with thecluster registry
.queryNames
(ObjectName pattern, Filter<ObjectName> filter) Get the names of MBeans controlled by the MBean server that is collocated with thecluster registry
.void
removeNotificationListener
(String sName, NotificationListener listener) Removes a listener from a registered MBean.void
removeNotificationListener
(String sName, NotificationListener listener, NotificationFilter filter, Object oHandback) Removes a listener from a registered MBean.void
setAttribute
(String sName, String sAttr, Object oValue) Set the value of the specified MBean attribute.
-
Constructor Details
-
WrapperMBeanServerProxy
Create aWrapperMBeanServerProxy
.- Parameters:
server
- theMBeanServer
to wrap
-
WrapperMBeanServerProxy
Create aWrapperMBeanServerProxy
.- Parameters:
supplier
- theSupplier
of theMBeanServer
to wrap
-
-
Method Details
-
getMBeanInfo
Description copied from interface:MBeanServerProxy
Return the MBeanInfo for a given MBean.- Specified by:
getMBeanInfo
in interfaceMBeanServerProxy
- Parameters:
sName
- the MBean name- Returns:
- the MBeanInfo for the MBean or
null
if the MBean does not exist
-
execute
Description copied from interface:MBeanServerProxy
Afunction
executed on the management node. The function is provided a local MBeanServer and can return any serializable result.- Specified by:
execute
in interfaceMBeanServerProxy
- Type Parameters:
R
- the return type- Parameters:
function
- the function to execute- Returns:
- the result returned by the function
-
getAttributes
Description copied from interface:MBeanServerProxy
Return a Map of attribute name to attribute value for a given MBean name.The attributes returned must evaluate successfully against the provided
Filter
to be returned.- Specified by:
getAttributes
in interfaceMBeanServerProxy
- Parameters:
sName
- the MBean namefilter
- filter to limit the returned attributes- Returns:
- a Map of attribute name to attribute value
-
getAttribute
Description copied from interface:MBeanServerProxy
Obtain the value of the specified MBean attribute.- Specified by:
getAttribute
in interfaceMBeanServerProxy
- Parameters:
sName
- the MBean namesAttr
- the attribute name- Returns:
- the value of the retrieved attribute
-
setAttribute
Description copied from interface:MBeanServerProxy
Set the value of the specified MBean attribute.- Specified by:
setAttribute
in interfaceMBeanServerProxy
- Parameters:
sName
- the MBean namesAttr
- the attribute nameoValue
- the attribute value
-
invoke
Description copied from interface:MBeanServerProxy
Invoke an operation on the specified MBean.- Specified by:
invoke
in interfaceMBeanServerProxy
- Parameters:
sName
- the MBean name to invoke the method onsOpName
- the name of the method to be invokedaoParams
- an array containing the method parametersasSignature
- an optional array containing the method signatures, this parameter is only necessary if there are multiple methods with the same name- Returns:
- the result of invocation
-
queryNames
Description copied from interface:MBeanServerProxy
Get the names of MBeans controlled by the MBean server that is collocated with thecluster registry
.- Specified by:
queryNames
in interfaceMBeanServerProxy
- Parameters:
sPattern
- the MBean name pattern identifying MBean names to be retrieved; this pattern is the same as in theMBeanServer.queryNames
method; if null, the name of all registered MBeans will be retrievedfilter
- (optional) the filter to be applied for selecting MBeans- Returns:
- a set of MBean names matching the pattern and the filter
-
queryNames
Description copied from interface:MBeanServerProxy
Get the names of MBeans controlled by the MBean server that is collocated with thecluster registry
.- Specified by:
queryNames
in interfaceMBeanServerProxy
- Parameters:
pattern
- the MBean name pattern identifying MBean names to be retrieved; this pattern is the same as in theMBeanServer.queryNames
method; if null, the name of all registered MBeans will be retrievedfilter
- (optional) the filter to be applied for selecting MBeans- Returns:
- a set of MBean names matching the pattern and the filter
-
isMBeanRegistered
Description copied from interface:MBeanServerProxy
Check whether or not an MBean with the specified name is already registered.- Specified by:
isMBeanRegistered
in interfaceMBeanServerProxy
- Parameters:
sName
- the MBean name- Returns:
- true iff the specified name is already registered
-
local
Description copied from interface:MBeanServerProxy
Return a local onlyMBeanServerProxy
.A local only proxy operates only on the MBeans that are local to this member.
- Specified by:
local
in interfaceMBeanServerProxy
- Returns:
- a local only
MBeanServerProxy
-
addNotificationListener
public void addNotificationListener(String sName, NotificationListener listener, NotificationFilter filter, Object oHandback) Description copied from interface:MBeanServerProxy
Adds a listener to a registered MBean.Notifications emitted by the MBean will be forwarded to the listener.
- Specified by:
addNotificationListener
in interfaceMBeanServerProxy
- Parameters:
sName
- the name of the MBean on which the listener should be addedlistener
- the listener object which will handle the notifications emitted by the registered MBeanfilter
- the filter object. If filter is null, no filtering will be performed before handling notificationsoHandback
- the context to be sent to the listener when a notification is emitted- See Also:
-
removeNotificationListener
Description copied from interface:MBeanServerProxy
Removes a listener from a registered MBean.If the listener is registered more than once, perhaps with different filters or callbacks, this method will remove all those registrations.
- Specified by:
removeNotificationListener
in interfaceMBeanServerProxy
- Parameters:
sName
- the name of the MBean on which the listener should be removedlistener
- the listener to be removed- See Also:
-
removeNotificationListener
public void removeNotificationListener(String sName, NotificationListener listener, NotificationFilter filter, Object oHandback) Description copied from interface:MBeanServerProxy
Removes a listener from a registered MBean.The MBean must have a listener that exactly matches the given
listener
,filter
, andhandback
parameters. If there is more than one such listener, only one is removed.The
filter
andhandback
parameters may be null if and only if they are null in a listener to be removed.- Specified by:
removeNotificationListener
in interfaceMBeanServerProxy
- Parameters:
sName
- the name of the MBean on which the listener should be removedlistener
- the listener to be removedfilter
- the filter that was specified when the listener was addedoHandback
- the handback that was specified when the listener was added- See Also:
-