KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > base > BulkAccess


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/base/BulkAccess.java,v 1.3 2005/12/25 03:48:55 tcfujii Exp $
26  * $Revision: 1.3 $
27  * $Date: 2005/12/25 03:48:55 $
28  */

29 package com.sun.appserv.management.base;
30
31 import java.util.Set JavaDoc;
32
33 import javax.management.ObjectName JavaDoc;
34 import javax.management.Attribute JavaDoc;
35 import javax.management.AttributeList JavaDoc;
36
37 import com.sun.appserv.management.base.AMX;
38 import com.sun.appserv.management.base.XTypes;
39
40 /**
41     Bulk access to various JMX constructs. The term "bulk" refers to the fact the multiple
42     MBeans are accessed together on the server side, to minimize remote
43     invocation of many MBeans.
44     <p>
45     Because a failure can occur with a particular MBeans, results or failures are
46     communicated back in an array of the exact size of the original ObjectName[].
47     Examining the results array yields either the result, or a Throwable, if one
48     occured. This is why all results are of type Object[].
49     <p>
50     Clients wishing to use this interface should note that they may first
51     need to obtain an ObjectName[] from a Set or Map of {@link AMX}. The easiest way
52     to do this is to use {@link Util#toObjectNames} followed by
53     conversion of the Set to an ObjectName[].
54  */

55 public interface BulkAccess extends Utility, AMX, Singleton
56 {
57 /** The j2eeType as returned by {@link com.sun.appserv.management.base.AMX#getJ2EEType}. */
58     public static final String JavaDoc J2EE_TYPE = XTypes.BULK_ACCESS;
59
60     
61     /**
62         Call getMBeanInfo() for multiple MBeans.
63         For objectNames[ i ], results[ i ] will be the resulting MBeanInfo[],
64         or contain a Throwable if something was thrown.
65         
66         @param objectNames
67         @return Info[], one for each objectName, null if not found
68      */

69     public Object JavaDoc[] bulkGetMBeanInfo( ObjectName JavaDoc[] objectNames );
70     
71     /**
72         Call getMBeanInfo().getAttributes() for multiple MBeans.
73         For objectNames[ i ], results[ i ] will be the resulting MBeanAttributeInfo[],
74         or contain a Throwable if something was thrown.
75         
76         @param objectNames
77         @return AttributeInfo[][], one AttributeInfo[] for each objectName, null if not found
78      */

79     public Object JavaDoc[] bulkGetMBeanAttributeInfo( ObjectName JavaDoc[] objectNames );
80     
81     /**
82         Call getMBeanInfo().getOperations() for multiple MBeans.
83         For objectNames[ i ], results[ i ] will be the resulting MBeanOperationInfo[],
84         or contain a Throwable if something was thrown.
85         
86         @param objectNames
87         @return OperationInfo[][], one OperationInfo[] for each objectName, null if not found
88      */

89     public Object JavaDoc[] bulkGetMBeanOperationInfo( ObjectName JavaDoc[] objectNames );
90     
91     /**
92         Call getMBeanInfo().getAttributes() for multiple MBeans, then extracts the
93         Attribute name from each Attribute.
94         For objectNames[ i ], results[ i ] will be the resulting String[], consisting
95         of all Attribute names for that MBean,
96         or contain a Throwable if something was thrown.
97         
98         @param objectNames
99         @return Object[][], one String[] for each objectName, null if not found, or a Throwable
100      */

101     public Object JavaDoc[] bulkGetAttributeNames( ObjectName JavaDoc[] objectNames );
102     
103     
104     /**
105         Call getAttribute( attributeName ) for multiple MBeans.
106         For objectNames[ i ], results[ i ] will be the resulting value,
107         or contain a Throwable if something was thrown..
108         
109         @param objectNames
110         @param attributeName
111         @return array of Object, which may be the Attribute value, or a Throwable
112      */

113     public Object JavaDoc[] bulkGetAttribute( final ObjectName JavaDoc[] objectNames,
114                         final String JavaDoc attributeName );
115                         
116     /**
117         Call setAttribute( attr ) for multiple MBeans.
118         For objectNames[ i ], results[ i ] will be null if successful,
119         or contain a Throwable if not.
120         
121         @param objectNames
122         @param attr
123         @return array of Object, each is null or a Throwable
124      */

125     public Object JavaDoc[] bulkSetAttribute( final ObjectName JavaDoc[] objectNames,
126                         final Attribute JavaDoc attr );
127                         
128     
129     /**
130         Call getAttributes( attributeNames ) for multiple MBeans.
131         For objectNames[ i ], results[ i ] will contain the resulting
132         AttributeList, or a Throwable if unsuccessful.
133         
134         @return array of Object, which may be the AttributeList, or a Throwable
135      */

136     public Object JavaDoc[] bulkGetAttributes( final ObjectName JavaDoc[] objectNames,
137                         final String JavaDoc[] attributeNames );
138                         
139     
140     /**
141         Call invoke( ... ) for multiple MBeans.
142         For objectNames[ i ], results[ i ] will be the result,
143         or contain a Throwable if something was thrown..
144         <p>
145         <b>WARNING: No guarantee can be made that the MBeans being
146         invoked will not alter their arguments, thus altering the
147         parameters that subsequent MBeans receive when invoked.</b>
148         
149         @param objectNames
150         @param operationName
151         @param args
152         @param types
153         @return array of Object, which will be the result of the invoke, or a Throwable
154      */

155     public Object JavaDoc[] bulkInvoke( final ObjectName JavaDoc[] objectNames,
156                         final String JavaDoc operationName,
157                         final Object JavaDoc[] args, final String JavaDoc[] types );
158 }
159
160
161
Popular Tags