|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.admin.extern.JmxWrapper
public class JmxWrapper
JmxWrapper wraps the MBeanServer instance. Current supported adaptors are a HTTPAdaptor, the XmlBlasterAdaptor and the JDK1.5 jconsole adaptor.
1. | xmlBlaster/jmx/HtmlAdaptor | true: Start the adaptor for html-browser access |
2. | xmlBlaster/jmx/XmlBlasterAdaptor | true |
3a. | java -Dcom.sun.management.jmxremote ... | Start the JDK 1.5 jconsole adaptor by the java virtual machine |
3b. | xmlBlaster/jmx/rmi | true: Start the JDK 1.5 jconsole adaptor by our own coding |
-xmlBlaster/jmx/rmiregistry/port Specify a port number where rmiregistry listens. Default is port 1099 -xmlBlaster/jmx/rmiregistry/hostname Specify a hostname where rmiregistry runs. Default is the dns name of the running host.
http://java.sun.com/developer/technicalArticles/J2SE/jmx.html
,
XmlBlasterSecurityManager
,
The admin.jmx requirementField Summary | |
---|---|
static int |
DEFAULT_REGISTRY_PORT
XmlBlaster RMI registry listen port is 1099, to access for bootstrapping |
Constructor Summary | |
---|---|
JmxWrapper(Global glob)
Constructs an initial JmxWrapper object. |
Method Summary | |
---|---|
static JmxWrapper |
getInstance(Global glob)
Singleton to avoid that different Global instances create more than one JmxWrapper. |
javax.management.MBeanServer |
getMBeanServer()
Create the unique MBeanServer instance. |
static java.lang.String |
getObjectNameLiteral(Global global,
ContextNode contextNode)
|
void |
init()
Initialize the MBean server and adaptors. |
java.lang.Object |
invokeAction(java.lang.String args)
Invoke xmlBlaster core JMX bean operations and getter/setter. |
java.lang.Object |
invokeCommand(java.lang.String command)
Similat to invokeAction but the command does not need to start with "/InvokeAction//", additionally the "set" feature is activated. |
boolean |
isActivated()
Check if JMX is activated. |
boolean |
isRegistered(ContextNode contextNode)
|
JmxMBeanHandle |
registerMBean(ContextNode contextNode,
java.lang.Object mbean)
Registers the specified mbean into the mbean server. |
int |
renameMBean(java.lang.String oldName,
java.lang.String oldRootClassname,
ContextNode newRootNode)
Reorganize the registration for a new parent node. |
int |
renameMBean(java.lang.String oldName,
java.lang.String classNameToChange,
java.lang.String instanceName)
Reorganize the registration for a new parent node. |
void |
shutdown()
|
void |
startXmlBlasterConnector(javax.management.MBeanServer mbeanServer)
Starts XmlBlasterConnector on mbeanServer-Instance This is a small embedded xmlBlaster server instance which is started. |
void |
unregisterMBean(JmxMBeanHandle jmxMBeanHandle)
|
void |
unregisterMBean(javax.management.ObjectName objectName)
Unregisters the specified mbean from the mbean server. |
static java.lang.String |
validateJmxValue(java.lang.String value)
JMX property values may not contain a comma ','. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_REGISTRY_PORT
Constructor Detail |
---|
public JmxWrapper(Global glob) throws XmlBlasterException
XmlBlasterException
Method Detail |
---|
public static JmxWrapper getInstance(Global glob) throws XmlBlasterException
XmlBlasterException
public boolean isActivated()
public javax.management.MBeanServer getMBeanServer()
public static java.lang.String validateJmxValue(java.lang.String value)
value
- The value to verify
public void init() throws XmlBlasterException
XmlBlasterException
public int renameMBean(java.lang.String oldName, java.lang.String oldRootClassname, ContextNode newRootNode)
oldName
- The existing registry, is used to lookup all matching sub-entries.
For example "org.xmlBlaster:nodeClass=node,node=clientSUB1"oldRootClassname
- The existing parent node like
"org.xmlBlaster:nodeClass=node,node=clientjoe1"
Note: Instance names may not contain commas "," for example "joe,Smith" is not valid
public int renameMBean(java.lang.String oldName, java.lang.String classNameToChange, java.lang.String instanceName)
oldName
- The existing registry, is used to lookup all matching sub-entries.
For example "org.xmlBlaster:nodeClass=node,node=clientSUB1"newNodeClass
- The new parent node like
"org.xmlBlaster:nodeClass=node,node=heron"
Note: Instance names may not contain commas "," for example "joe,Smith" is not valid
public JmxMBeanHandle registerMBean(ContextNode contextNode, java.lang.Object mbean)
contextNode
- The unique name for JMX observation
Note: Instance names may not contain commas "," for example "joe,Smith" is not validmbean
- the MBean object instance
If mbean implements MBeanRegistration:preRegister() we don't need the type, name
public static java.lang.String getObjectNameLiteral(Global global, ContextNode contextNode)
public java.lang.Object invokeCommand(java.lang.String command)
command
- for example "org.xmlBlaster:nodeClass=node,node="heron"/action=getFreeMemStr"
invokeAction(String)
public java.lang.Object invokeAction(java.lang.String args)
java -Djmx.invoke.getters=set ... org.xmlBlaster.Main
args
- could be somethig like:
'/InvokeAction//org.xmlBlaster:nodeClass=node,node="izar",contribClass=contrib,contrib="Heini"
/action=myNiceMethodName?action=myNiceMethodName&p1+java.lang.String=arg1&p2+java.lang.String=arg1'
or
'org.xmlBlaster:nodeClass=node,node="heron",topicClass=topic,topic="watchDog"/action=getNumOfHistoryEntries'
or
'org.xmlBlaster:nodeClass=node,node="heron",topicClass=topic,topic="watchDog"/action=usage'
or
'j org.xmlBlaster:nodeClass=node,node="heron",topicClass=topic,topic="watchDog"/action=peekHistoryMessages?p1+int=1
or much simpler (will return the usage() string):
org.xmlBlaster:nodeClass=node,node="heron"/action=usagepublic void unregisterMBean(javax.management.ObjectName objectName)
objectName
- The object you got from registerMBean() of type ObjectName,
if null nothing happenspublic void unregisterMBean(JmxMBeanHandle jmxMBeanHandle)
public void startXmlBlasterConnector(javax.management.MBeanServer mbeanServer) throws XmlBlasterException
XmlBlasterException
public void shutdown()
public boolean isRegistered(ContextNode contextNode) throws XmlBlasterException
XmlBlasterException
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |