KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > management > j2eemanagement > J2EEDeployedObject


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  * --------------------------------------------------------------------------
21  * $Id: J2EEDeployedObject.java,v 1.4 2004/06/15 13:54:40 danesa Exp $
22  * --------------------------------------------------------------------------
23  */

24
25 package org.objectweb.jonas.management.j2eemanagement;
26
27 // JMX
28
import javax.management.ObjectName JavaDoc;
29 import javax.management.MalformedObjectNameException JavaDoc;
30
31 // JOnAS JMX
32
import org.objectweb.jonas.jmx.J2eeObjectName;
33
34 /**
35  * A J2EE MBean deployed on server.
36  *
37  * @author Michel-Ange Anton
38  */

39 public class J2EEDeployedObject extends J2EEManagedObject {
40
41
42 // ------------------------------------------------------------- Privates Variables
43

44 // ------------------------------------------------------------- Properties
45

46     /**
47      * J2EE Deployment descriptor.
48      */

49     private String JavaDoc deploymentDescriptor = null;
50
51     /**
52      * Specific JOnAS Deployment descriptor.
53      */

54     private String JavaDoc jonasDeploymentDescriptor = null;
55
56
57 // ------------------------------------------------------------- Contructors
58

59     /**
60      * MBean constructor.
61      * @param p_ObjectName The object name of the deployed object
62      */

63     protected J2EEDeployedObject(String JavaDoc p_ObjectName) {
64         super(p_ObjectName);
65     }
66
67     /**
68      * MBean constructor.
69      * @param p_ObjectName The object name of the managed object
70      * @param p_StateManageable If true, this object implements J2EE State Management Model
71      * @param p_StatisticsProvider If true, this object implements the J2EE StatisticProvide Model
72      * @param p_EventProvider If true, this object implements the J2EE EventProvider Model
73      */

74     protected J2EEDeployedObject(String JavaDoc p_ObjectName, boolean p_StateManageable
75         , boolean p_StatisticsProvider, boolean p_EventProvider) {
76         super(p_ObjectName, p_StateManageable, p_StatisticsProvider, p_EventProvider);
77     }
78
79 // ------------------------------------------------------------- Properties Methods
80

81     public String JavaDoc getDeploymentDescriptor() {
82         return deploymentDescriptor;
83     }
84
85     public void setDeploymentDescriptor(String JavaDoc deploymentDescriptor) {
86         this.deploymentDescriptor = deploymentDescriptor;
87     }
88
89     public String JavaDoc getJonasDeploymentDescriptor() {
90         return jonasDeploymentDescriptor;
91     }
92
93     public void setJonasDeploymentDescriptor(String JavaDoc jonasDeploymentDescriptor) {
94         this.jonasDeploymentDescriptor = jonasDeploymentDescriptor;
95     }
96
97 // ------------------------------------------------------------- Public Methods
98

99     public String JavaDoc getServer() {
100         String JavaDoc s = null;
101         try {
102             ObjectName JavaDoc on = new ObjectName JavaDoc(getObjectName());
103             s = J2eeObjectName.J2EEServer(on.getDomain()
104                 , on.getKeyProperty(J2EE_TYPE_SERVER)).toString();
105         }
106         catch (MalformedObjectNameException JavaDoc e) {
107             // none action
108
}
109         return s;
110     }
111 }
112
Popular Tags