KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > j2ee > J2EEModuleImplBase


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /*
25  * $Header: /cvs/glassfish/admin/mbeanapi-impl/src/java/com/sun/enterprise/management/j2ee/J2EEModuleImplBase.java,v 1.4 2005/12/25 03:40:06 tcfujii Exp $
26  * $Revision: 1.4 $
27  * $Date: 2005/12/25 03:40:06 $
28  */

29  
30 package com.sun.enterprise.management.j2ee;
31
32 import java.util.Set JavaDoc;
33
34 import javax.management.ObjectName JavaDoc;
35 import javax.management.AttributeNotFoundException JavaDoc;
36
37 import com.sun.appserv.management.j2ee.J2EEModule;
38 import com.sun.appserv.management.j2ee.J2EEServer;
39
40
41 import com.sun.appserv.management.base.Util;
42
43
44 import com.sun.appserv.management.util.jmx.JMXUtil;
45 import com.sun.appserv.management.util.misc.GSetUtil;
46
47 import com.sun.appserv.management.j2ee.J2EETypes;
48
49 import com.sun.enterprise.management.support.Delegate;
50
51 /**
52  */

53 public class J2EEModuleImplBase extends J2EEDeployedObjectImplBase
54 {
55         public
56     J2EEModuleImplBase(
57         final Delegate delegate )
58     {
59         super( delegate );
60     }
61     
62     private static final Set JavaDoc<String JavaDoc> NOT_SUPERFLUOUS =
63         GSetUtil.newUnmodifiableStringSet(
64             "getJVMObjectName"
65             );
66         protected Set JavaDoc<String JavaDoc>
67     getNotSuperfluousMethods()
68     {
69         return NOT_SUPERFLUOUS;
70     }
71     
72     
73         protected boolean
74     isStandalone()
75     {
76         // caution--could be called when ObjectName is not yet set
77
return getObjectName() != null &&
78             getKeyProperty( J2EETypes.J2EE_APPLICATION ).equals( NULL_NAME );
79     }
80     
81         public boolean
82     isConfigProvider()
83     {
84         return( super.isConfigProvider() && getObjectName() != null && isStandalone() );
85     }
86     
87         public String JavaDoc[]
88     getjavaVMs()
89     {
90         return( getJ2EEServer().getjavaVMs() );
91     }
92     
93         public ObjectName JavaDoc
94     getJVMObjectName()
95     {
96         return Util.getObjectName( getJ2EEServer().getJVM() );
97     }
98
99     /** jsr77 StateManageable impl. */
100
101         public boolean
102     isstateManageable()
103     {
104         return isStandAlone();
105     }
106
107         private boolean
108     isStandAlone()
109     {
110         return !getContainer().getJ2EEType().equals( J2EETypes.J2EE_APPLICATION );
111     }
112 }
113
Popular Tags