Client.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:cacheonix-core 作者:
public static void main(String[] args) throws Exception
{
   // The RMI server's host: this is actually ignored by JSR 160
   // since this information is stored in the RMI stub.
   String serverHost = "localhost";

   // The host where the rmiregistry runs.
   String namingHost = "localhost";

   String jndiPath = "/ssljmxconnector";
   JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://" + serverHost + "/jndi/rmi://" + namingHost + jndiPath);
   JMXConnector connector = JMXConnectorFactory.connect(url);
   MBeanServerConnection connection = connector.getMBeanServerConnection();

   // Call the server side
   ObjectName delegateName = ObjectName.getInstance("JMImplementation:type=MBeanServerDelegate");
   Object proxy = MBeanServerInvocationHandler.newProxyInstance(connection, delegateName, MBeanServerDelegateMBean.class, true);
   MBeanServerDelegateMBean delegate = (MBeanServerDelegateMBean)proxy;

   System.out.println(delegate.getImplementationVendor() + " is cool !");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号