springjmxserver.java

来自「jmx在spring中的实现」· Java 代码 · 共 39 行

JAVA
39
字号
/*
======================================================================

  SpringJmxServer.java

  Created by Claude Duguay
  Copyright (c) 2005

======================================================================
*/

package com.claudeduguay.jmx.demo.server;

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

import mx4j.tools.adaptor.http.*;

/*
 * To use the SpringJmxServer, use the following command line
 * arguments to activate the Java 1.5 JMX Server.
 * 
 * -Dcom.sun.management.jmxremote.port=8999
 * -Dcom.sun.management.jmxremote.ssl=false
 * -Dcom.sun.management.jmxremote.authenticate=false
 */

public class SpringJmxServer
{
	public static void main(String[] args)
		throws Exception
	{
		String SPRING_FILE = "com/claudeduguay/jmx/demo/server/SpringJmxServer.xml";
		ApplicationContext context = new ClassPathXmlApplicationContext(SPRING_FILE);
		HttpAdaptor httpAdaptor = (HttpAdaptor)context.getBean("HttpAdaptor");
		httpAdaptor.start();
	}
}

⌨️ 快捷键说明

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