|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-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(javax.management.MBeanServer server, java.lang.String sPattern, java.lang.String sAttribute) Calculate the average of the attribute values across all the MBeans with a given name pattern. |
static int |
compareKeyList(javax.management.ObjectName oname1, javax.management.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(java.lang.String sName) Ensure that there is an instance of a local MBean of the specified type registered with the default MBeansServer. |
static javax.management.MBeanServer |
findMBeanServer() Find an MBeanServer that Coherence MBeans are registered with. |
static javax.management.MBeanServer |
findMBeanServer(java.lang.String sDefaultDomain) Find an MBeanServer that has the specified default domain name. |
static java.lang.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(java.lang.String sCanonical) Return true if the Canonical name is prefixed with the domain name. |
static boolean |
isQuoteRequired(java.lang.String s) Determine if the string requires quotes. |
static java.lang.String |
quote(java.lang.String s) Create an escape-sequence string that allows for special characters to be included in a JMX ObjectName. |
static java.lang.String |
quoteCanonical(java.lang.String sCanonical) Return a quoted KeyPropertyString or a quoted canonical name. |
static void |
registerCacheMBean(CacheService service, java.lang.String sCacheName, java.lang.String sContext, java.util.Map map) Register the specified map with the cluster registry. |
static void |
registerCacheMBean(NamedCache cache, java.lang.String sContext) Register the specified NamedCache with the cluster registry. |
static void |
registerQueryMBeans(java.lang.String sMBeanServerDomain, java.lang.String sQuery, java.lang.String sPrefix, Registry registry) Find all MBeans matching to the specified query at a local MBeanServer and register them with the specified Registry. |
static java.lang.Object |
startHttpConnector(int nPort, javax.management.MBeanServer mbs) Start a com.sun.jdmk.comm.HtmlAdaptorServer, which is a part of the Sun JMX reference implementation. |
static javax.management.remote.JMXConnectorServer |
startRmiConnector(java.lang.String sHost, int nRegPort, int nConPort, javax.management.MBeanServer mbs, java.util.Map mapEnv) Start a JMXConnectorServer . |
static java.lang.String |
stripDomain(java.lang.String sCanonical) Remove the domain prefix from the canonical name if one exists. |
static java.lang.String |
unquote(java.lang.String s) Convert a string returned from the quote(java.lang.String) method to the original string. |
static void |
unregisterCacheMBean(CacheService service, java.lang.String sCacheName) Unregister all managed objects that are related to the specified cache from the registry. |
static void |
unregisterCacheMBean(java.lang.String sCacheName, java.lang.String sContext) Unregister all managed objects related to the given cache name and context from the cluster registry. |
Constructor Detail |
---|
public MBeanHelper()
Method Detail |
---|
public static java.lang.String getDefaultDomain()
public static MBeanServerFinder getServerFinder()
public static javax.management.MBeanServer findMBeanServer()
public static javax.management.MBeanServer findMBeanServer(java.lang.String sDefaultDomain)
sDefaultDomain
- the default domain namepublic static void registerQueryMBeans(java.lang.String sMBeanServerDomain, java.lang.String sQuery, java.lang.String sPrefix, Registry registry)
Note: the MBeanServer that the query runs against is not necesserily the one used by the 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 void registerCacheMBean(NamedCache cache, java.lang.String sContext)
cache
- the NamedCache object to registersContext
- the cache context (tier)public static void registerCacheMBean(CacheService service, java.lang.String sCacheName, java.lang.String sContext, java.util.Map map)
service
- the CacheService that the cache belongs tosCacheName
- the cache namesContext
- the cache context (tier)map
- the map object to registerpublic static void unregisterCacheMBean(CacheService service, java.lang.String sCacheName)
service
- the CacheService that the cache belongs tosCacheName
- the cache namepublic static void unregisterCacheMBean(java.lang.String sCacheName, java.lang.String sContext)
sCacheName
- the cache namesContext
- the cache context (tier)public static double calculateAverage(javax.management.MBeanServer server, java.lang.String sPattern, java.lang.String sAttribute)
server
- the MBeanServersPattern
- the name patternsAttribute
- the attribute namepublic static MBeanReference ensureSingletonMBean(java.lang.String sName)
sName
- an MBean namepublic static javax.management.remote.JMXConnectorServer startRmiConnector(java.lang.String sHost, int nRegPort, int nConPort, javax.management.MBeanServer mbs, java.util.Map mapEnv)
JMXConnectorServer
. This method is used to expose the specified MBeanServer to external agents (such as JConsole) using RMI.
This method also allows for the RMI functionality to emulate the JConsole remote connection security.
For the list of relevant system properties please see:
sHost
- 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 java.lang.Object startHttpConnector(int nPort, javax.management.MBeanServer mbs)
nPort
- port to bind the HTTP server tombs
- MBeanServer that this HTTP server will exposepublic static java.lang.String quote(java.lang.String s)
s
- the string to be quotedpublic static java.lang.String unquote(java.lang.String s)
quote(java.lang.String)
method to the original string.s
- the string to be unquotedjava.lang.IllegalArgumentException
- 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(java.lang.String s)
s
- the string to be quotedquote(java.lang.String)
method needs to be calledpublic static java.lang.String quoteCanonical(java.lang.String sCanonical) throws javax.management.MalformedObjectNameException
KeyPropertyString
or a quoted canonical name.sCanonical
- a string to be quotedjavax.management.MalformedObjectNameException
- if the name is invalidpublic static boolean hasDomain(java.lang.String sCanonical)
sCanonical
- a canonical MBean name or key property listpublic static java.lang.String stripDomain(java.lang.String sCanonical)
sCanonical
- a canonical MBean name or key property listpublic static int compareKeyList(javax.management.ObjectName oname1, javax.management.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.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |