⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soapinvocationhandler.java

📁 jmx codeJava源码
💻 JAVA
字号:

package book.jmx.examples;

import java.util.*;
import java.net.*;
import java.lang.reflect.*;
import java.rmi.*;
import electric.registry.*;


public class SOAPInvocationHandler 
    implements InvocationHandler, SOAPConnectorConstants {

  // the remote interface
  private MBeanServerInvoker invoker = null;
  
  public SOAPInvocationHandler(Properties props) 
      throws RegistryException {
          
    System.setProperty("electric.xml.io.serialize", "yes");
    
    // retrieve the connection properties
    String host = props.getProperty(HOST, "localhost");
    String port = props.getProperty(PORT, "8085");
    String name = props.getProperty(NAME);
    String path = props.getProperty(PATH, "");
    
    // retrieve the stub
    String url = "http://" + host + ":" + port + "/" + path + "/" + name;
    invoker = (MBeanServerInvoker)Registry.bind(url, MBeanServerInvoker.class);
        
  }   
    
  public Object invoke(Object proxy, Method method,
                       Object[] args) throws Throwable {
                       
    String methodName = method.getName();

    MethodInvocation mi = new MethodInvocation(method);
    mi.setParams(args);

    return invoker.invoke(mi);
  }
  
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -