00001 /* 00002 * JOnAS: Java(TM) Open Application Server 00003 * Copyright (C) 1999 Bull S.A. 00004 * Contact: jonas-team@objectweb.org 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00019 * USA 00020 * -------------------------------------------------------------------------- 00021 * $Id: J2EEModule.java,v 1.1 2004/01/16 17:25:10 antonma Exp $ 00022 * -------------------------------------------------------------------------- 00023 */ 00024 00025 package org.objectweb.jonas.management.j2eemanagement; 00026 00027 // JMX 00028 import javax.management.ObjectName; 00029 import javax.management.MalformedObjectNameException; 00030 00031 // JOnAS JMX 00032 import org.objectweb.jonas.jmx.J2eeObjectName; 00033 00039 public class J2EEModule extends J2EEDeployedObject { 00040 00041 // ------------------------------------------------------------- Private Constants 00042 00043 // ------------------------------------------------------------- Privates Variables 00044 00045 // ------------------------------------------------------------- Properties 00046 00047 // ------------------------------------------------------------- Contructors 00048 00053 protected J2EEModule(String p_ObjectName) { 00054 super(p_ObjectName); 00055 } 00056 00064 protected J2EEModule(String p_ObjectName, boolean p_StateManageable 00065 , boolean p_StatisticsProvider, boolean p_EventProvider) { 00066 super(p_ObjectName, p_StateManageable, p_StatisticsProvider, p_EventProvider); 00067 } 00068 00069 // ------------------------------------------------------------- Public Methods 00070 00075 public String[] getJavaVMs() { 00076 String[] as = new String[0]; 00077 try { 00078 ObjectName on = new ObjectName(getObjectName()); 00079 ObjectName onServer = J2eeObjectName.J2EEServer(on.getDomain() 00080 , on.getKeyProperty(J2EE_TYPE_SERVER)); 00081 as = (String[]) org.objectweb.jonas.jmx.JonasManagementRepr.getAttribute( 00082 onServer, "javaVMs"); 00083 } 00084 catch (MalformedObjectNameException e) { 00085 // none action 00086 } 00087 return as; 00088 } 00089 00090 }