Package com.drighetto.spring25x.jmx

Source Code of com.drighetto.spring25x.jmx.MainSampleWithAnnotationsSmallConfig

package com.drighetto.spring25x.jmx;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
* Entry point<br>
* Sample with the using of Java5 JMX annotations
*
* @author Dominique RIGHETTO <dominique.righetto@gmail.com>
*
*/
public class MainSampleWithAnnotationsSmallConfig {

  /**
   * Entry point
   *
   * @param args
   */
  @SuppressWarnings( { "unused", "boxing" })
  public static void main(String[] args) {
    try {
      System.out.println("******************");
      System.out.println("*  JMX SAMPLE    *");
      System.out.println("*  ANNOTATION    *");
      System.out.println("*  SMALL CONFIG  *");
      System.out.println("******************");

      // Create Spring context with the AbstractApplicationContext
      AbstractApplicationContext springCtx = new ClassPathXmlApplicationContext(
          "applicationContext-jmx-annotations-smallconfig.xml");

      // Wait in order to use the JConsole to access to MBean server...
      long waitTime = 90000000;
      System.out
          .printf(
              "Wait %sMS in order to use the JConsole to access to MBean server...",
              waitTime);
      Thread.sleep(waitTime);

    } catch (Exception e) {
      e.printStackTrace();
    }

  }

}
TOP

Related Classes of com.drighetto.spring25x.jmx.MainSampleWithAnnotationsSmallConfig

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.