KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > helper > DeployedItemHelper


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-core/mbeanapi/src/java/com/sun/appserv/management/helper/DeployedItemHelper.java,v 1.3 2005/12/25 03:50:36 tcfujii Exp $
26  * $Revision: 1.3 $
27  * $Date: 2005/12/25 03:50:36 $
28  */

29 package com.sun.appserv.management.helper;
30
31 import java.util.Set JavaDoc;
32 import java.util.HashSet JavaDoc;
33
34 import javax.management.ObjectName JavaDoc;
35
36 import com.sun.appserv.management.base.AMX;
37 import com.sun.appserv.management.base.XTypes;
38 import com.sun.appserv.management.base.Util;
39 import com.sun.appserv.management.DomainRoot;
40 import com.sun.appserv.management.base.QueryMgr;
41
42 /**
43     Helper for deployed items (modules).
44  */

45 public final class DeployedItemHelper extends Helper
46 {
47         public
48     DeployedItemHelper( final DomainRoot domainRoot )
49     {
50         super( domainRoot );
51     }
52
53     /**
54         Get the ObjectNames of all deployed items in the specified server.
55         To extract the names, use {@link Util}.getNamesSet(set).
56         
57         @param standaloneServerName
58         @return Set of ObjectName for all modules
59      */

60         public Set JavaDoc<ObjectName JavaDoc>
61     queryStandaloneServerDeployedItemObjectNames(
62         final String JavaDoc standaloneServerName )
63     {
64         // specify all STANDALONE_SERVER_DEPLOYED_ITEM_REF_CONFIG
65
final String JavaDoc refsProp =
66             Util.makeJ2EETypeProp( XTypes.DEPLOYED_ITEM_REF_CONFIG );
67             
68         // specify the server
69
final String JavaDoc serverProp =
70             Util.makeProp( XTypes.STANDALONE_SERVER_CONFIG, standaloneServerName );
71             
72         return( Util.toObjectNames( propsQuery( refsProp, serverProp ) ) );
73     }
74     
75     /**
76         Get the ObjectNames of all deployed items in the specified cluster.
77         To extract the names, use {@link Util}.getNamesSet(set).
78         
79         @param clusterName
80         @return Set of ObjectName for all modules
81      */

82         public Set JavaDoc<ObjectName JavaDoc>
83     queryClusterDeployedItemObjectNames(
84         final String JavaDoc clusterName )
85     {
86         // specify all STANDALONE_SERVER_DEPLOYED_ITEM_REF_CONFIG
87
final String JavaDoc refsProp =
88             Util.makeJ2EETypeProp( XTypes.DEPLOYED_ITEM_REF_CONFIG );
89             
90         // specify the server
91
final String JavaDoc clusterProp =
92             Util.makeProp( XTypes.CLUSTER_CONFIG, clusterName );
93             
94         return( Util.toObjectNames( propsQuery( refsProp, clusterProp ) ) );
95     }
96 }
97
98
99
Popular Tags