KickJava   Java API By Example, From Geeks To Geeks.

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


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/J2EEDomainImpl.java,v 1.5 2005/12/25 03:40:05 tcfujii Exp $
26  * $Revision: 1.5 $
27  * $Date: 2005/12/25 03:40:05 $
28  */

29 package com.sun.enterprise.management.j2ee;
30
31 import java.util.Map JavaDoc;
32 import java.util.Set JavaDoc;
33
34 import javax.management.ObjectName JavaDoc;
35
36 import com.sun.appserv.management.j2ee.J2EETypes;
37 import com.sun.appserv.management.j2ee.J2EEDomain;
38 import com.sun.appserv.management.j2ee.J2EEServer;
39 import com.sun.appserv.management.j2ee.J2EECluster;
40 import com.sun.appserv.management.base.XTypes;
41
42
43 import com.sun.appserv.management.base.Util;
44 import com.sun.appserv.management.util.misc.CollectionUtil;
45 import com.sun.appserv.management.util.misc.GSetUtil;
46
47 /**
48  */

49 public final class J2EEDomainImpl extends J2EEManagedObjectImplBase
50 {
51         public
52     J2EEDomainImpl()
53     {
54     }
55     
56         public boolean
57     isConfigProvider()
58     {
59         return( true );
60     }
61     
62     private static final Set JavaDoc<String JavaDoc> NOT_SUPERFLUOUS =
63         GSetUtil.newUnmodifiableStringSet( "getServerObjectNameMap", "getClusterObjectNameMap" );
64         
65         protected final Set JavaDoc<String JavaDoc>
66     getNotSuperfluousMethods()
67     {
68         return GSetUtil.newSet( super.getNotSuperfluousMethods(), NOT_SUPERFLUOUS );
69     }
70     
71         public Map JavaDoc<String JavaDoc,ObjectName JavaDoc>
72     getServerObjectNameMap()
73     {
74         return Util.toObjectNames( getSelfProxy().getJ2EEServerMap() );
75     }
76     
77         public Map JavaDoc<String JavaDoc,ObjectName JavaDoc>
78     getClusterObjectNameMap()
79     {
80         return Util.toObjectNames( getSelfProxy().getJ2EEClusterMap() );
81     }
82
83         private J2EEDomain
84     getSelfProxy()
85     {
86         return (J2EEDomain)getSelf();
87     }
88     
89     /**
90         JSR 77 impl
91         @return String representation of the ObjectName
92      */

93         public String JavaDoc[]
94     getservers()
95     {
96         final Map JavaDoc<String JavaDoc,J2EEServer> servers = getSelfProxy().getJ2EEServerMap();
97         final Map JavaDoc<String JavaDoc,ObjectName JavaDoc> objectNames = Util.toObjectNames( servers );
98         return( CollectionUtil.toStringArray( objectNames.values() ) );
99     }
100     
101         public ObjectName JavaDoc
102     getConfigPeerObjectName()
103     {
104         return Util.getObjectName( getDomainRoot().getDomainConfig() );
105     }
106
107     /**
108         JSR 77 impl
109         @return String representation of the ObjectName
110      */

111         public String JavaDoc[]
112     getclusters()
113     {
114         final Map JavaDoc<String JavaDoc,J2EECluster> clusters = getSelfProxy().getJ2EEClusterMap();
115         final Map JavaDoc<String JavaDoc,ObjectName JavaDoc> objectNames = Util.toObjectNames( clusters );
116         return( CollectionUtil.toStringArray( objectNames.values() ) );
117     }
118 }
119
120
121
Popular Tags