KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.io.Serializable JavaDoc;
26
27 import java.util.Set JavaDoc;
28 import java.util.Map JavaDoc;
29 import java.util.Collections JavaDoc;
30
31 import javax.management.MBeanInfo JavaDoc;
32
33 /**
34     Dummy implementation used when coverage is not being gathered.
35     @see AMXDebugStuff
36  */

37 public final class CoverageInfoDummy implements Serializable JavaDoc, CoverageInfo
38 {
39     public static final long serialVersionUID = 0xABCDEF;
40     
41         public
42     CoverageInfoDummy()
43     {
44     }
45
46     static private final Set JavaDoc<String JavaDoc> EMPTY_SET = Collections.emptySet();
47     static private final Map JavaDoc<String JavaDoc,Integer JavaDoc> EMPTY_MAP = Collections.emptyMap();
48     
49     public void clear() {}
50     
51     public MBeanInfo JavaDoc getMBeanInfo() { return null; }
52     public void setMBeanInfo(MBeanInfo JavaDoc info) { }
53     public void merge( final CoverageInfo info ) {}
54     
55     public Set JavaDoc<String JavaDoc> getReadableAttributes() { return EMPTY_SET; }
56     public Set JavaDoc<String JavaDoc> getWriteableAttributes() { return EMPTY_SET; }
57     public Set JavaDoc<String JavaDoc> getOperations() { return EMPTY_SET; }
58     
59     public Set JavaDoc<String JavaDoc> getAttributesRead() { return EMPTY_SET; }
60     public Set JavaDoc<String JavaDoc> getAttributesNotRead() { return EMPTY_SET; }
61     
62     public Set JavaDoc<String JavaDoc> getAttributesWritten() { return EMPTY_SET; }
63     public Set JavaDoc<String JavaDoc> getAttributesNotWritten() { return EMPTY_SET; }
64     
65     public Set JavaDoc<String JavaDoc> getOperationsInvoked() { return EMPTY_SET; }
66     public Set JavaDoc<String JavaDoc> getOperationsNotInvoked() { return EMPTY_SET; }
67     
68     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getAttributeGetFailures() { return EMPTY_MAP; }
69     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getAttributeSetFailures() { return EMPTY_MAP; }
70     
71     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getUnknownAttributes() { return EMPTY_MAP; }
72     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getUnknownOperations() { return EMPTY_MAP; }
73     
74     public Map JavaDoc<String JavaDoc,Integer JavaDoc> getInvocationFailures() { return EMPTY_MAP; }
75     
76     public String JavaDoc toString( final boolean verbose ) { return "CoverageInfoDummy"; }
77     
78     
79     public int getAttributeReadCoverage() { return 0; }
80     public int getAttributeWriteCoverage() { return 0; }
81     public int getOperationCoverage() { return 0; }
82     public boolean getFullCoverage() { return false; }
83     
84     public void ignoreUnknownAttribute( final String JavaDoc name ) {}
85     public void unknownAttribute( final String JavaDoc name ) {}
86     public void attributeWasRead( final String JavaDoc name ) {}
87     public void attributesWereRead( final String JavaDoc[] name ) {}
88     public void attributeWasWritten( final String JavaDoc name ) {}
89     public void attributeGetFailure( final String JavaDoc name ) {}
90     public void attributeSetFailure( final String JavaDoc name ) {}
91
92     public void unknownOperation(final String JavaDoc name, final String JavaDoc[] sig) {}
93     public void operationWasInvoked(final String JavaDoc name, final String JavaDoc[] sig) {}
94     public void markAsInvoked(final String JavaDoc fullname ){}
95     
96     public void operationFailed(final String JavaDoc name, final String JavaDoc[] sig) {}
97 }
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Popular Tags