KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > container > monitor > jvm > v15 > JVM15RootContainerInitializer


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.container.monitor.jvm.v15;
6
7 import java.lang.management.ManagementFactory JavaDoc;
8 import org.exoplatform.container.RootContainer;
9 import org.exoplatform.container.RootContainerInitializer;
10 import org.exoplatform.container.monitor.jvm.JVMRuntimeInfo;
11 /**
12  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
13  * @since Jan 11, 2005
14  * @version $Id$
15  */

16 public class JVM15RootContainerInitializer implements RootContainerInitializer {
17   
18   public void initialize(RootContainer container) {
19     container.registerComponentInstance(ManagementFactory.getOperatingSystemMXBean()) ;
20     container.registerComponentInstance(ManagementFactory.getRuntimeMXBean()) ;
21     container.registerComponentInstance(ManagementFactory.getThreadMXBean()) ;
22     container.registerComponentInstance(ManagementFactory.getClassLoadingMXBean()) ;
23     container.registerComponentInstance(ManagementFactory.getCompilationMXBean()) ;
24     
25     container.registerComponentInstance(new MemoryInfo()) ;
26     container.registerComponentInstance(JVMRuntimeInfo.MEMORY_MANAGER_MXBEANS, ManagementFactory.getMemoryManagerMXBeans()) ;
27     container.registerComponentInstance(JVMRuntimeInfo.MEMORY_POOL_MXBEANS, ManagementFactory.getMemoryPoolMXBeans()) ;
28     container.registerComponentInstance(JVMRuntimeInfo.GARBAGE_COLLECTOR_MXBEANS, ManagementFactory.getGarbageCollectorMXBeans()) ;
29   }
30 }
Popular Tags