jconsole service:jmx:rmi:///jndi/rmi://134.224.102.25:1099/Jmx_Message_SmppSmChannel_Url_ChannelId_2C网中心
JMX调用例子:
if (channelId == 1 || channelId == 2) {
try {
JMXServiceURL url = null;
ObjectName mBeanName = null;
if (channelId == 1) {
url = new JMXServiceURL(
"service:jmx:rmi:///jndi/rmi://134.224.102.25:1099/Jmx_Message_SmppSmChannel_Url_ChannelId_1");
mBeanName = new ObjectName(
"SmppSmChannelAgent:name=SmppSmChannelImpl1");
} else if (channelId == 2) {
url = new JMXServiceURL(
"service:jmx:rmi:///jndi/rmi://134.224.102.25:1099/Jmx_Message_SmppSmChannel_Url_ChannelId_2");
mBeanName = new ObjectName(
"SmppSmChannelAgent:name=SmppSmChannelImpl2");
}
JMXConnector jmxc = JMXConnectorFactory.connect(url);
MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
// Object[] params = new Object[];
// mbsc.invoke(mBeanName, "printGreeting",null,null);
// int flowLimit =(Integer)mbsc.getAttribute(mBeanName,
// "FlowLimit");
// System.out.println("wxf_test in updateSmChannel....flowLimit=:"+flowLimit);
Attribute attribute = new Attribute("FlowLimit", channelSpeed);
mbsc.setAttribute(mBeanName, attribute);
// flowLimit =(Integer)mbsc.getAttribute(mBeanName,
// "FlowLimit");
// System.out.println("wxf_test in updateSmChannel....flowLimit=:"+flowLimit);
} catch (Exception ex) {
ex.printStackTrace();
}