com.caucho.jmx
Class Jmx

java.lang.Object
  extended by com.caucho.jmx.Jmx

public class Jmx
extends java.lang.Object

Static convenience methods.


Constructor Summary
Jmx()
           
 
Method Summary
static java.util.LinkedHashMap<java.lang.String,java.lang.String> copyContextProperties()
          Returns a copy of the context properties.
static java.util.LinkedHashMap<java.lang.String,java.lang.String> copyContextProperties(java.lang.ClassLoader loader)
          Returns a copy of the context properties.
static void dequeue(java.util.TimerTask job)
          Dequeues a task.
static java.lang.Object find(javax.management.ObjectName name)
          Returns the local manged object.
static java.lang.Object find(javax.management.ObjectName name, java.lang.ClassLoader loader)
          Returns the local manged object.
static java.lang.Object find(javax.management.ObjectName name, java.lang.ClassLoader loader, javax.management.MBeanServer mbeanServer)
          Returns the local manged object.
static java.lang.Object find(java.lang.String localName)
          Returns the local manged object.
static java.lang.Object findGlobal(javax.management.ObjectName name)
          Returns the local manged object.
static java.lang.Object findGlobal(java.lang.String localName)
          Returns the local manged object.
static javax.management.MBeanServer getContextMBeanServer()
          Returns the context mbean server.
static javax.management.MBeanServer getGlobalMBeanServer()
          Returns the global mbean server.
static AbstractMBeanServer getMBeanServer()
          Gets the static mbean server.
static javax.management.ObjectName getObjectName(java.lang.String name)
          Returns an ObjectName based on a short name.
static javax.management.ObjectName getObjectName(java.lang.String domain, java.util.Map<java.lang.String,java.lang.String> properties)
          Creates the clean name
static void parseProperties(java.util.Map<java.lang.String,java.lang.String> properties, java.lang.String name)
          Parses a name.
static java.util.LinkedHashMap<java.lang.String,java.lang.String> parseProperties(java.lang.String name)
          Parses a name.
static java.util.ArrayList<java.lang.Object> query(javax.management.ObjectName namePattern)
          Returns the local manged object.
static void queueAbsolute(java.util.TimerTask job, long time)
          Queues a task.
static void queueRelative(java.util.TimerTask job, long delta)
          Queues a task.
static javax.management.ObjectInstance register(java.lang.Object object, java.util.Map<java.lang.String,java.lang.String> properties)
          Conditionally registers an MBean with the server.
static javax.management.ObjectInstance register(java.lang.Object object, javax.management.ObjectName name)
          Registers an MBean with the server.
static javax.management.ObjectInstance register(java.lang.Object object, javax.management.ObjectName name, java.lang.Class api)
          Registers an MBean with the server.
static javax.management.ObjectInstance register(java.lang.Object object, javax.management.ObjectName name, java.lang.ClassLoader loader)
          Registers an MBean with the server.
static javax.management.ObjectInstance register(java.lang.Object object, java.lang.String name)
          Conditionally registers an MBean with the server.
static javax.management.ObjectInstance register(java.lang.Object object, java.lang.String name, java.lang.Class api)
          Registers an MBean with the server.
static javax.management.ObjectInstance registerContext(java.lang.Object object, java.lang.String name)
          Conditionally registers an MBean with the server.
static void setContextProperties(java.util.Map<java.lang.String,java.lang.String> properties)
          Sets the context properties.
static void setContextProperties(java.util.Map<java.lang.String,java.lang.String> properties, java.lang.ClassLoader loader)
          Sets the context properties.
static void unregister(javax.management.ObjectName name)
          Unregisters an MBean with the server.
static void unregister(javax.management.ObjectName name, java.lang.ClassLoader loader)
          Unregisters an MBean with the server.
static void unregister(java.lang.String name)
          Conditionally registers an MBean with the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jmx

public Jmx()
Method Detail

getContextMBeanServer

public static javax.management.MBeanServer getContextMBeanServer()
Returns the context mbean server.


getGlobalMBeanServer

public static javax.management.MBeanServer getGlobalMBeanServer()
Returns the global mbean server.


getMBeanServer

public static AbstractMBeanServer getMBeanServer()
Gets the static mbean server.


copyContextProperties

public static java.util.LinkedHashMap<java.lang.String,java.lang.String> copyContextProperties()
Returns a copy of the context properties.


copyContextProperties

public static java.util.LinkedHashMap<java.lang.String,java.lang.String> copyContextProperties(java.lang.ClassLoader loader)
Returns a copy of the context properties.


setContextProperties

public static void setContextProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Sets the context properties.


setContextProperties

public static void setContextProperties(java.util.Map<java.lang.String,java.lang.String> properties,
                                        java.lang.ClassLoader loader)
Sets the context properties.


register

public static javax.management.ObjectInstance register(java.lang.Object object,
                                                       java.lang.String name)
                                                throws javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MalformedObjectNameException,
                                                       javax.management.NotCompliantMBeanException
Conditionally registers an MBean with the server.

Parameters:
object - the object to be registered as an MBean
name - the name of the mbean.
Returns:
the instantiated object.
Throws:
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MalformedObjectNameException
javax.management.NotCompliantMBeanException

registerContext

public static javax.management.ObjectInstance registerContext(java.lang.Object object,
                                                              java.lang.String name)
                                                       throws javax.management.InstanceAlreadyExistsException,
                                                              javax.management.MBeanRegistrationException,
                                                              javax.management.MalformedObjectNameException,
                                                              javax.management.NotCompliantMBeanException
Conditionally registers an MBean with the server.

Parameters:
object - the object to be registered as an MBean
name - the name of the mbean.
Returns:
the instantiated object.
Throws:
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MalformedObjectNameException
javax.management.NotCompliantMBeanException

register

public static javax.management.ObjectInstance register(java.lang.Object object,
                                                       java.util.Map<java.lang.String,java.lang.String> properties)
                                                throws javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MalformedObjectNameException,
                                                       javax.management.NotCompliantMBeanException
Conditionally registers an MBean with the server.

Parameters:
object - the object to be registered as an MBean
name - the name of the mbean.
Returns:
the instantiated object.
Throws:
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MalformedObjectNameException
javax.management.NotCompliantMBeanException

register

public static javax.management.ObjectInstance register(java.lang.Object object,
                                                       javax.management.ObjectName name)
                                                throws javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.NotCompliantMBeanException
Registers an MBean with the server.

Parameters:
object - the object to be registered as an MBean
name - the name of the mbean.
Returns:
the instantiated object or null if the object doesn't have an MBean interface.
Throws:
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException

register

public static javax.management.ObjectInstance register(java.lang.Object object,
                                                       javax.management.ObjectName name,
                                                       java.lang.ClassLoader loader)
                                                throws javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.NotCompliantMBeanException
Registers an MBean with the server.

Parameters:
object - the object to be registered as an MBean
name - the name of the mbean.
Returns:
the instantiated object.
Throws:
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException

unregister

public static void unregister(javax.management.ObjectName name)
                       throws javax.management.MBeanRegistrationException,
                              javax.management.InstanceNotFoundException
Unregisters an MBean with the server.

Parameters:
name - the name of the mbean.
Throws:
javax.management.MBeanRegistrationException
javax.management.InstanceNotFoundException

unregister

public static void unregister(javax.management.ObjectName name,
                              java.lang.ClassLoader loader)
                       throws javax.management.MBeanRegistrationException,
                              javax.management.InstanceNotFoundException
Unregisters an MBean with the server.

Parameters:
name - the name of the mbean.
Throws:
javax.management.MBeanRegistrationException
javax.management.InstanceNotFoundException

register

public static javax.management.ObjectInstance register(java.lang.Object object,
                                                       java.lang.String name,
                                                       java.lang.Class api)
                                                throws javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MalformedObjectNameException,
                                                       javax.management.NotCompliantMBeanException
Registers an MBean with the server.

Parameters:
object - the object to be registered as an MBean
name - the name of the mbean.
api - the api for the server
Returns:
the instantiated object.
Throws:
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MalformedObjectNameException
javax.management.NotCompliantMBeanException

register

public static javax.management.ObjectInstance register(java.lang.Object object,
                                                       javax.management.ObjectName name,
                                                       java.lang.Class api)
                                                throws javax.management.InstanceAlreadyExistsException,
                                                       javax.management.MBeanRegistrationException,
                                                       javax.management.MalformedObjectNameException,
                                                       javax.management.NotCompliantMBeanException
Registers an MBean with the server.

Parameters:
object - the object to be registered as an MBean
name - the name of the mbean.
api - the api for the server
Returns:
the instantiated object.
Throws:
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MalformedObjectNameException
javax.management.NotCompliantMBeanException

unregister

public static void unregister(java.lang.String name)
                       throws javax.management.InstanceNotFoundException,
                              javax.management.MalformedObjectNameException,
                              javax.management.MBeanRegistrationException
Conditionally registers an MBean with the server.

Parameters:
object - the object to be registered as an MBean
name - the name of the mbean.
Throws:
javax.management.InstanceNotFoundException
javax.management.MalformedObjectNameException
javax.management.MBeanRegistrationException

getObjectName

public static javax.management.ObjectName getObjectName(java.lang.String name)
                                                 throws javax.management.MalformedObjectNameException
Returns an ObjectName based on a short name.

Throws:
javax.management.MalformedObjectNameException

parseProperties

public static java.util.LinkedHashMap<java.lang.String,java.lang.String> parseProperties(java.lang.String name)
Parses a name.


parseProperties

public static void parseProperties(java.util.Map<java.lang.String,java.lang.String> properties,
                                   java.lang.String name)
Parses a name.


getObjectName

public static javax.management.ObjectName getObjectName(java.lang.String domain,
                                                        java.util.Map<java.lang.String,java.lang.String> properties)
                                                 throws javax.management.MalformedObjectNameException
Creates the clean name

Throws:
javax.management.MalformedObjectNameException

find

public static java.lang.Object find(java.lang.String localName)
                             throws javax.management.MalformedObjectNameException
Returns the local manged object.

Throws:
javax.management.MalformedObjectNameException

find

public static java.lang.Object find(javax.management.ObjectName name)
Returns the local manged object.


findGlobal

public static java.lang.Object findGlobal(java.lang.String localName)
                                   throws javax.management.MalformedObjectNameException
Returns the local manged object.

Throws:
javax.management.MalformedObjectNameException

findGlobal

public static java.lang.Object findGlobal(javax.management.ObjectName name)
Returns the local manged object.


find

public static java.lang.Object find(javax.management.ObjectName name,
                                    java.lang.ClassLoader loader)
Returns the local manged object.


find

public static java.lang.Object find(javax.management.ObjectName name,
                                    java.lang.ClassLoader loader,
                                    javax.management.MBeanServer mbeanServer)
Returns the local manged object.


query

public static java.util.ArrayList<java.lang.Object> query(javax.management.ObjectName namePattern)
Returns the local manged object.


queueAbsolute

public static void queueAbsolute(java.util.TimerTask job,
                                 long time)
Queues a task.


queueRelative

public static void queueRelative(java.util.TimerTask job,
                                 long delta)
Queues a task.


dequeue

public static void dequeue(java.util.TimerTask job)
Dequeues a task.