KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > support > CoverageInfo


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 package com.sun.enterprise.management.support;
24
25
26 import java.util.Set JavaDoc;
27 import java.util.HashSet JavaDoc;
28 import java.util.Map JavaDoc;
29 import java.util.HashMap JavaDoc;
30 import java.util.Collection JavaDoc;
31 import java.util.Collections JavaDoc;
32
33 import javax.management.MBeanInfo JavaDoc;
34 import javax.management.MBeanAttributeInfo JavaDoc;
35 import javax.management.MBeanOperationInfo JavaDoc;
36
37
38 /**
39     Used to record access to AMX.
40     @see AMXDebugStuff
41  */

42 public interface CoverageInfo
43 {
44     /** reset coverage data to empty */
45     public void clear();
46     
47     /** get the current MBeanInfo, possibly null if not yet set */
48     public MBeanInfo JavaDoc getMBeanInfo();
49     
50     /**
51         Set the current MBeanInfo. Should be set prior to calling
52         other routines because it is used to recognize unknown Attributes
53         and operations.
54       */

55     public void setMBeanInfo( final MBeanInfo JavaDoc mbeanInfo );
56     public void merge( final CoverageInfo info );
57     
58     
59     /**
60         Get the Set of legal attributes which can be read.
61      */

62     public Set JavaDoc<String JavaDoc> getReadableAttributes();
63     
64     /**
65         Get the Set of legal attributes which can be read.
66      */

67     public Set JavaDoc<String JavaDoc> getWriteableAttributes();
68     
69     /**
70         Get the Set of legal operations which can be invoked.
71         Format: opname(<signature>);
72      */

73     public Set JavaDoc<String JavaDoc> getOperations();
74     
75     /**
76         Get the Set of legal attributes which were read.
77      */

78     public Set JavaDoc<String JavaDoc> getAttributesRead();
79     
80     /**
81         Get the Set of legal attributes which were NOT read.
82      */

83     public Set JavaDoc<String JavaDoc> getAttributesNotRead();
84     
85     
86     /**
87         Get the Set of legal attributes which were written.
88      */

89     public Set JavaDoc<String JavaDoc> getAttributesWritten();
90     
91     /**
92         Get the Set of legal attributes which were NOT written.
93      */

94     public Set JavaDoc<String JavaDoc> getAttributesNotWritten();
95     
96     /**
97         Get the Set of legal operations which were invoked.
98      */

99     public Set JavaDoc<String JavaDoc> getOperationsInvoked();
100     
101     /**
102         Get the Set of legal operations which were NOT invoked.
103      */

104     public Set JavaDoc<String JavaDoc> getOperationsNotInvoked();
105     
106     /**
107         Get a Map<attribute name, count> of Attribute read failures
108         for legal attributes.
109      */

110     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getAttributeGetFailures();
111     
112     /**
113         Get a Map<attribute name, count> of Attribute write failures
114         for legal attributes.
115      */

116     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getAttributeSetFailures();
117     
118     /**
119         Get a Map<attribute name, count> of unknown Attribute accesses.
120      */

121     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getUnknownAttributes();
122     
123     /**
124         Get a Map<operation name, count> of unknown operation accesses.
125      */

126     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getUnknownOperations();
127
128     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getInvocationFailures();
129     
130     /**
131         Produce a useful string for current information.
132      */

133     public String JavaDoc toString( final boolean verbose );
134     
135     /** 0-100%, based on legal readable Attributes */
136     public int getAttributeReadCoverage();
137     
138     /** 0-100%, based on legal writeable Attributes */
139     public int getAttributeWriteCoverage();
140     
141     /** 0-100%, based on legal operations */
142     public int getOperationCoverage();
143     
144     /** @return true if 100% coverage, false otherwise */
145     public boolean getFullCoverage();
146     
147     /**
148        Remove the Attribute from the list of unknown Attributes.
149        Used to "clean up" the output for known transgressions.
150      */

151     public void ignoreUnknownAttribute( final String JavaDoc name );
152     
153     /**
154        Record the fact that a request was made to read the Attribute.
155      */

156     public void attributeWasRead( final String JavaDoc name );
157     
158     /**
159        Record the fact that a request was made to read the Attributes.
160      */

161     public void attributesWereRead( final String JavaDoc[] names );
162     
163     /**
164        Record the fact that a failure occurred while reading the Attribute.
165      */

166     public void attributeGetFailure( final String JavaDoc name );
167     
168     /**
169        Record the fact that a request was made to write the Attribute.
170      */

171     public void attributeWasWritten( final String JavaDoc name );
172     
173     /**
174        Record the fact that a failure occurred while writing the Attribute.
175      */

176     public void attributeSetFailure( final String JavaDoc name );
177
178     /**
179        Record the fact that a request was made to invoke the operation.
180      */

181     public void operationWasInvoked(final String JavaDoc name, final String JavaDoc[] sig);
182     
183     /**
184        Mark the operation as having been invoked. Usually used to be able to ignore
185        certain known cases of operations that can't be invoked remotely,
186        such as add/removeNotificationListener (certain forms).
187      */

188     public void markAsInvoked(final String JavaDoc fullname );
189     
190     /**
191        Record the fact that a failure occurred while invoking the operation.
192      */

193     public void operationFailed(final String JavaDoc name, final String JavaDoc[] sig);
194
195 }
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
Popular Tags