|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.management.MBeanHelper
public abstract class MBeanHelper
Helper class providing various functionality related to aggregation of attributes and methods exposed by Coherence JMX framework MBeans.
Constructor Summary | |
---|---|
MBeanHelper() |
Method Summary | |
---|---|
static double |
calculateAverage(MBeanServer server, String sPattern, String sAttribute) Calculate the average of the attribute values across all the MBeans with a given name pattern. |
static int |
compareKeyList(ObjectName oname1, ObjectName oname2) Compare two global MBean names forcing numeric comparison of the node ID while using string comparison on all other key properties. |
static MBeanReference |
ensureSingletonMBean(String sName) Ensure that there is an instance of a local MBean of the specified type registered with the default MBeansServer. |
static MBeanServer |
findMBeanServer() Find an MBeanServer that Coherence MBeans are registered with. |
static MBeanServer |
findMBeanServer(String sDefaultDomain) Find an MBeanServer that has the specified default domain name. |
static String |
getDefaultDomain() Return the the default domain name as configured in the Coherence operational configuration descriptor ("default-domain-name" element). |
static MBeanServerFinder |
getServerFinder() Return the the MBeanServerFinder as configured in the Coherence operational configuration descriptor ("server-factory" element). |
static boolean |
hasDomain(String sCanonical) Return true if the Canonical name is prefixed with the domain name. |
static boolean |
isQuoteRequired(String s) Determine if the string requires quotes. |
static String |
quote(String s) Create an escape-sequence string that allows for special characters to be included in a JMX ObjectName. |
static String |
quoteCanonical(String sCanonical) Return a quoted KeyPropertyString or a quoted canonical name. |
static void |
registerQueryMBeans(String sMBeanServerDomain, String sQuery, String sPrefix, Registry registry) Find all MBeans matching to the specified query at a local MBeanServer and register them with the specified Registry. |
static Object |
startHttpConnector(int nPort, MBeanServer mbs) Start a com.sun.jdmk.comm.HtmlAdaptorServer, which is a part of the Sun JMX reference implementation. |
static JMXConnectorServer |
startRmiConnector(String sHost, int nRegPort, int nConPort, MBeanServer mbs, Map mapEnv) Start a JMXConnectorServer . |
static String |
stripDomain(String sCanonical) Remove the domain prefix from the canonical name if one exists. |
static String |
unquote(String s) Convert a string returned from the quote(java.lang.String) method to the original string. |
Constructor Detail |
---|
public MBeanHelper()
Method Detail |
---|
public static String getDefaultDomain()
public static MBeanServerFinder getServerFinder()
public static MBeanServer findMBeanServer()
public static MBeanServer findMBeanServer(String sDefaultDomain)
sDefaultDomain
- the default domain namepublic static void registerQueryMBeans(String sMBeanServerDomain, String sQuery, String sPrefix, Registry registry)
sMBeanServerDomain
- the default domain of the MBeanServer where the query should be executed. If this value is empty or null the Coherence default domain is usedsQuery
- a JMX query string that will be used to find the MBeanssPrefix
- a target location to prepend to converted MBean namesregistry
- a Registry to register the JMX query results withpublic static double calculateAverage(MBeanServer server, String sPattern, String sAttribute)
server
- the MBeanServersPattern
- the name patternsAttribute
- the attribute namepublic static MBeanReference ensureSingletonMBean(String sName)
sName
- an MBean namepublic static JMXConnectorServer startRmiConnector(String sHost, int nRegPort, int nConPort, MBeanServer mbs, Map mapEnv)
JMXConnectorServer
. This method is used to expose the specified MBeanServer to external agents (such as JConsole) using RMI. <p/> This method also allows for the RMI functionality to emulate the JConsole remote connection security. <p/> For the list of relevant system properties please see: <p/> Java 1.5 Agent Documentation, Java 1.6 Agent DocumentationsHost
- host to bind tonRegPort
- port used for the JMX RMI registrynConPort
- port used for the JMX RMI connectionmbs
- MBeanServer
that contains Coherence MBeansmapEnv
- a set of attributes to control the new connector server's behaviorJMXConnectorServerFactory
public static Object startHttpConnector(int nPort, MBeanServer mbs)
nPort
- port to bind the HTTP server tombs
- MBeanServer that this HTTP server will exposepublic static String quote(String s)
s
- the string to be quotedpublic static String unquote(String s)
quote(java.lang.String)
method to the original string.s
- the string to be unquotedIllegalArgumentException
- if the passed string could not have been returned by the quote(java.lang.String)
method; for instance if it does not begin and end with a quote (")public static boolean isQuoteRequired(String s)
s
- the string to be quotedquote(java.lang.String)
method needs to be calledpublic static String quoteCanonical(String sCanonical) throws MalformedObjectNameException
KeyPropertyString
or a quoted canonical name.sCanonical
- a string to be quotedMalformedObjectNameException
- if the name is invalidpublic static boolean hasDomain(String sCanonical)
sCanonical
- a canonical MBean name or key property listpublic static String stripDomain(String sCanonical)
sCanonical
- a canonical MBean name or key property listpublic static int compareKeyList(ObjectName oname1, ObjectName oname2)
global MBean names
forcing numeric comparison of the node ID while using string comparison on all other key properties. For example, the following order is enforced:
Coherence:type=Node,nodeId=2 < Coherence:type=Node,nodeId=10 Coherence:type=Cache,nodeId=20 < Coherence:type=Node,nodeId=1If the key sets are different the lexicographical comparison is used.
oname1
- the first ObjectName to be comparedoname2
- the second ObjectName to be compared
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |