Package com.opencloud.slee.remote
Class RemoteUsage.UsageReader
- java.lang.Object
-
- com.opencloud.slee.remote.RemoteUsage.UsageReader
-
- Enclosing class:
- RemoteUsage
public static class RemoteUsage.UsageReader extends Object
Helps obtaining usage parameters by name. This class can be instantiated directly by a client if an ObjectName reference has already been obtained, but is normally created and returned by calling on of the following methods (or the equivalent method for the unnamed parameter set): *RemoteUsage.Subsystems.getUsageReader(javax.management.MBeanServerConnection, String, String)
*RemoteUsage.Sbbs.getUsageReader(javax.management.MBeanServerConnection, javax.slee.ServiceID, javax.slee.SbbID, String)
*RemoteUsage.Profiles.getUsageReader(javax.management.MBeanServerConnection, String, String)
*RemoteUsage.Resources.getUsageReader(javax.management.MBeanServerConnection, String, String)
-
-
Constructor Summary
Constructors Constructor Description UsageReader(MBeanServerConnection server, ObjectName objectName)
Create an instance of UsageReader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the Usage MBean.long
getCounterValue(String name, boolean reset)
Get the value of a counter usage parameter.int
getParameterCount()
Get the number of usage parameters.SampleStatistics
getSampleStatistics(String name, boolean reset)
Get the value of a sample usage parameter.boolean
isCounter(String name)
Check whether a usage parameter is a counter.boolean
isSample(String name)
Check whether a usage parameter is a sample statistic.Iterator
nameIterator()
Get an iterator of the usage parameter names.
-
-
-
Constructor Detail
-
UsageReader
public UsageReader(MBeanServerConnection server, ObjectName objectName) throws ManagementException
Create an instance of UsageReader.- Parameters:
server
- a server connectionobjectName
- the objectName of the Usage MBean- Throws:
ManagementException
-
-
Method Detail
-
getParameterCount
public int getParameterCount() throws ManagementException
Get the number of usage parameters.- Returns:
- number of usage parameters
- Throws:
ManagementException
-
nameIterator
public Iterator nameIterator() throws ManagementException
Get an iterator of the usage parameter names.- Returns:
- usage parameter names
- Throws:
ManagementException
-
isSample
public boolean isSample(String name)
Check whether a usage parameter is a sample statistic.- Parameters:
name
- usage parameter name- Returns:
- true if the usage parameter is a sample statistic, false if not
-
isCounter
public boolean isCounter(String name)
Check whether a usage parameter is a counter.- Parameters:
name
- usage parameter name- Returns:
- true if the usage parameter is a counter statistic, false if not
-
getCounterValue
public long getCounterValue(String name, boolean reset) throws ManagementException
Get the value of a counter usage parameter.- Parameters:
name
- usage parameter namereset
- if true, counter will be reset to zero- Returns:
- the value of usage parameter value
- Throws:
ManagementException
-
getSampleStatistics
public SampleStatistics getSampleStatistics(String name, boolean reset) throws ManagementException
Get the value of a sample usage parameter.- Parameters:
name
- usage parameter namereset
- if true, sample will be reset- Returns:
- the value of usage parameter value
- Throws:
ManagementException
-
close
public void close() throws ManagementException
Close the Usage MBean.- Throws:
ManagementException
- if any problem occurs closing the MBean
-
-