KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > mbeans > custom > CustomMBeanConfigQueries


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 package com.sun.enterprise.admin.mbeans.custom;
25 import java.util.List JavaDoc;
26 import javax.management.ObjectName JavaDoc;
27
28 /** Defines the behavior for querying the various MBean definitions. This is to factor
29  * out the MBean related operations. The implementing classes could have specific behaviors
30  * depending upon product edition, for example.
31  * @since SJSAS9.0
32  */

33 public interface CustomMBeanConfigQueries {
34     
35     /** Returns the collection of all the custom MBeans for a target as a List of Strings. Each element
36      * in the list the <i> name </i> of the custom MBean created. Thus for a standalone instance
37      * this method would return all the MBeans that are referenced from it.
38      * @param target String representing the cluster or server instance
39      * @return a List of Strings representing the referenced MBeans
40      * @throws CustomMBeanException
41      */

42     public List JavaDoc<String JavaDoc> listMBeanNames(String JavaDoc target) throws CustomMBeanException;
43     
44     /** Returns access to get more information about the custom MBeans referenced from a
45      * server instance. Every Config MBean is a wrapper over the domain.xml element and
46      * the ObjectName of this MBean can allow clients to get more information such as ObjectType of
47      * the custom MBean, by standard JMX calls. This method returns such ObjectNames. This method
48      * is more useful with a caveat that getting more information from the server results
49      * in additional calls to the server.
50      * @see #listMBeanNames(String) which returns only the names of these MBeans
51      * @param target String representing the cluster or server instance
52      * @return a List of ObjectNames representing the Config MBeans representing referenced MBeans
53      * @throws CustomMBeanException
54      */

55     public List JavaDoc<ObjectName JavaDoc> listMBeanConfigObjectNames(String JavaDoc target) throws CustomMBeanException;
56     
57     /** A convenience method to take care of various client requests. It resembles the function
58      * of a filter. Useful in getting the List of MBeans that for example are of object-type "USER_DEFINED"
59      * and are not enabled. This is a more general purpose query interface.
60      * @param target String representing the cluster or server instance
61      * @param type an integer representing the type of MBean
62      * @state boolean representing if or not the MBean is enabled
63      * @see CustomMBeanConstants
64      * @see #listMBeanConfigObjectNames(String)
65      * @return the List of Config MBeans that represent an MBean definition referenced from a server instance or cluster
66      */

67     public List JavaDoc<ObjectName JavaDoc> listMBeanConfigObjectNames(String JavaDoc target, int type, boolean state) throws CustomMBeanException;
68     
69     /** Returns if the given MBean is referenced from a given target.
70      * @param target String representing the cluster or server instance
71      * @param name String representing the <i> name </name> of the MBean
72      * @return a boolean representing if the given MBean exists in the given target
73      * @throws CustomMBeanException
74      */

75     public boolean existsMBean(String JavaDoc target, String JavaDoc name) throws CustomMBeanException;
76     
77     /** Returns if the given MBean is referenced from a given target and is enabled.
78      * @param target String representing the cluster or server instance
79      * @param name String representing the <i> name </name> of the MBean
80      * @return a boolean representing if the given MBean exists in the given target and is enabled
81      * @throws CustomMBeanException
82      */

83     public boolean isMBeanEnabled(String JavaDoc target, String JavaDoc name) throws CustomMBeanException;
84 }
Popular Tags