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

📄 managedbeanimpl.java

📁 JMX是一个很好的技术
💻 JAVA
字号:
package simon.tools.jmx;

import org.springframework.context.*;
import org.springframework.context.support.*;

public class ManagedBeanImpl
    implements ManagedBean {
  public ManagedBeanImpl() {}

  private String someProperty;
  public void setSomeProperty(String someProperty) {
    this.someProperty = someProperty;
  }

  public String getSomeProperty() {
    return someProperty;
  }

  public String doSomething() {
    return "Here's some property: " + someProperty;
  }

  /**
   * 运行此类,即可访问 http://localhost:9092管理所有的MBean,并能运行其中的方法
   * 其滋味真是妙不可言
   * @param args
   */
  public static void main(String[] args) {
    String path = "simon/tools/jmx/springconfig.xml";
    ApplicationContext context = new ClassPathXmlApplicationContext(path);
  }

}

⌨️ 快捷键说明

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