001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: * --------------------------------------------------------------------------
021: * $Id: J2EEDeployedObject.java 4954 2004-06-15 13:54:40Z danesa $
022: * --------------------------------------------------------------------------
023: */package org.objectweb.jonas.management.j2eemanagement;
024:
025: // JMX
026: import javax.management.ObjectName;
027: import javax.management.MalformedObjectNameException;
028:
029: // JOnAS JMX
030: import org.objectweb.jonas.jmx.J2eeObjectName;
031:
032: /**
033: * A J2EE MBean deployed on server.
034: *
035: * @author Michel-Ange Anton
036: */
037: public class J2EEDeployedObject extends J2EEManagedObject {
038:
039: // ------------------------------------------------------------- Privates Variables
040:
041: // ------------------------------------------------------------- Properties
042:
043: /**
044: * J2EE Deployment descriptor.
045: */
046: private String deploymentDescriptor = null;
047:
048: /**
049: * Specific JOnAS Deployment descriptor.
050: */
051: private String jonasDeploymentDescriptor = null;
052:
053: // ------------------------------------------------------------- Contructors
054:
055: /**
056: * MBean constructor.
057: * @param p_ObjectName The object name of the deployed object
058: */
059: protected J2EEDeployedObject(String p_ObjectName) {
060: super (p_ObjectName);
061: }
062:
063: /**
064: * MBean constructor.
065: * @param p_ObjectName The object name of the managed object
066: * @param p_StateManageable If true, this object implements J2EE State Management Model
067: * @param p_StatisticsProvider If true, this object implements the J2EE StatisticProvide Model
068: * @param p_EventProvider If true, this object implements the J2EE EventProvider Model
069: */
070: protected J2EEDeployedObject(String p_ObjectName,
071: boolean p_StateManageable, boolean p_StatisticsProvider,
072: boolean p_EventProvider) {
073: super (p_ObjectName, p_StateManageable, p_StatisticsProvider,
074: p_EventProvider);
075: }
076:
077: // ------------------------------------------------------------- Properties Methods
078:
079: public String getDeploymentDescriptor() {
080: return deploymentDescriptor;
081: }
082:
083: public void setDeploymentDescriptor(String deploymentDescriptor) {
084: this .deploymentDescriptor = deploymentDescriptor;
085: }
086:
087: public String getJonasDeploymentDescriptor() {
088: return jonasDeploymentDescriptor;
089: }
090:
091: public void setJonasDeploymentDescriptor(
092: String jonasDeploymentDescriptor) {
093: this .jonasDeploymentDescriptor = jonasDeploymentDescriptor;
094: }
095:
096: // ------------------------------------------------------------- Public Methods
097:
098: public String getServer() {
099: String s = null;
100: try {
101: ObjectName on = new ObjectName(getObjectName());
102: s = J2eeObjectName.J2EEServer(on.getDomain(),
103: on.getKeyProperty(J2EE_TYPE_SERVER)).toString();
104: } catch (MalformedObjectNameException e) {
105: // none action
106: }
107: return s;
108: }
109: }
|