KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > api > persistence > enhancer > meta > JDOMetaDataTimer


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 package com.sun.jdo.api.persistence.enhancer.meta;
26
27 import com.sun.jdo.api.persistence.enhancer.util.Support;
28
29
30 //@olsen: new class
31
public final class JDOMetaDataTimer
32     extends Support
33     implements JDOMetaData
34 {
35     // delegate
36
final protected JDOMetaData delegate;
37
38     /**
39      * Creates an instance.
40      */

41     public JDOMetaDataTimer(JDOMetaData delegate)
42         throws JDOMetaDataUserException, JDOMetaDataFatalError
43     {
44         affirm(delegate);
45         this.delegate = delegate;
46     }
47
48     public boolean isPersistenceCapableClass(String JavaDoc classPath)
49         throws JDOMetaDataUserException, JDOMetaDataFatalError
50     {
51         try {
52             timer.push("JDOMetaData.isPersistenceCapableClass(String)",//NOI18N
53
"JDOMetaData.isPersistenceCapableClass(" + classPath + ")");//NOI18N
54
return delegate.isPersistenceCapableClass(classPath);
55         } finally {
56             timer.pop();
57         }
58     }
59
60     public boolean isTransientClass(String JavaDoc classPath)
61         throws JDOMetaDataUserException, JDOMetaDataFatalError
62     {
63         try {
64             timer.push("JDOMetaData.isTransientClass(String)",//NOI18N
65
"JDOMetaData.isTransientClass(" + classPath + ")");//NOI18N
66
return delegate.isTransientClass(classPath);
67         } finally {
68             timer.pop();
69         }
70     }
71
72     public boolean isPersistenceCapableRootClass(String JavaDoc classPath)
73         throws JDOMetaDataUserException, JDOMetaDataFatalError
74     {
75         try {
76             timer.push("JDOMetaData.isPersistenceCapableRootClass(String)",//NOI18N
77
"JDOMetaData.isPersistenceCapableRootClass(" + classPath + ")");//NOI18N
78
return delegate.isPersistenceCapableRootClass(classPath);
79         } finally {
80             timer.pop();
81         }
82     }
83
84     public String JavaDoc getSuperClass(String JavaDoc classPath)
85         throws JDOMetaDataUserException, JDOMetaDataFatalError
86     {
87         try {
88             timer.push("JDOMetaData.getSuperClass(String)",//NOI18N
89
"JDOMetaData.getSuperClass(" + classPath + ")");//NOI18N
90
return delegate.getSuperClass(classPath);
91         } finally {
92             timer.pop();
93         }
94     }
95
96     public String JavaDoc getPersistenceCapableRootClass(String JavaDoc classPath)
97         throws JDOMetaDataUserException, JDOMetaDataFatalError
98     {
99         try {
100             timer.push("JDOMetaData.getPersistenceCapableRootClass(String)",//NOI18N
101
"JDOMetaData.getPersistenceCapableRootClass(" + classPath + ")");//NOI18N
102
return delegate.getPersistenceCapableRootClass(classPath);
103         } finally {
104             timer.pop();
105         }
106     }
107
108     public boolean isSecondClassObjectType(String JavaDoc classPath)
109         throws JDOMetaDataUserException, JDOMetaDataFatalError
110     {
111         try {
112             timer.push("JDOMetaData.isSecondClassObjectType(String)",//NOI18N
113
"JDOMetaData.isSecondClassObjectType(" + classPath + ")");//NOI18N
114
return delegate.isSecondClassObjectType(classPath);
115         } finally {
116             timer.pop();
117         }
118     }
119
120     public boolean isMutableSecondClassObjectType(String JavaDoc classPath)
121         throws JDOMetaDataUserException, JDOMetaDataFatalError
122     {
123         try {
124             timer.push("JDOMetaData.isMutableSecondClassObjectType(String)",//NOI18N
125
"JDOMetaData.isMutableSecondClassObjectType(" + classPath + ")");//NOI18N
126
return delegate.isMutableSecondClassObjectType(classPath);
127         } finally {
128             timer.pop();
129         }
130     }
131
132     public boolean isPersistentField(String JavaDoc classPath, String JavaDoc fieldName)
133         throws JDOMetaDataUserException, JDOMetaDataFatalError
134     {
135         try {
136             timer.push("JDOMetaData.isPersistentField(String,String)",//NOI18N
137
"JDOMetaData.isPersistentField(" + classPath//NOI18N
138
+ ", " + fieldName + ")");//NOI18N
139
return delegate.isPersistentField(classPath, fieldName);
140         } finally {
141             timer.pop();
142         }
143     }
144
145     public boolean isTransactionalField(String JavaDoc classPath, String JavaDoc fieldName)
146         throws JDOMetaDataUserException, JDOMetaDataFatalError
147     {
148         try {
149             timer.push("JDOMetaData.isTransactionalField(String,String)",//NOI18N
150
"JDOMetaData.isTransactionalField(" + classPath//NOI18N
151
+ ", " + fieldName + ")");//NOI18N
152
return delegate.isTransactionalField(classPath, fieldName);
153         } finally {
154             timer.pop();
155         }
156     }
157
158     public boolean isPrimaryKeyField(String JavaDoc classPath, String JavaDoc fieldName)
159         throws JDOMetaDataUserException, JDOMetaDataFatalError
160     {
161         try {
162             timer.push("JDOMetaData.isPrimaryKeyField(String,String)",//NOI18N
163
"JDOMetaData.isPrimaryKeyField(" + classPath//NOI18N
164
+ ", " + fieldName + ")");//NOI18N
165
return delegate.isPrimaryKeyField(classPath, fieldName);
166         } finally {
167             timer.pop();
168         }
169     }
170
171     public boolean isDefaultFetchGroupField(String JavaDoc classPath, String JavaDoc fieldName)
172         throws JDOMetaDataUserException, JDOMetaDataFatalError
173     {
174         try {
175             timer.push("JDOMetaData.isDefaultFetchGroupField(String,fieldName)",//NOI18N
176
"JDOMetaData.isDefaultFetchGroupField(" + classPath//NOI18N
177
+ ", " + fieldName + ")");//NOI18N
178
return delegate.isDefaultFetchGroupField(classPath, fieldName);
179         } finally {
180             timer.pop();
181         }
182     }
183
184     public int getFieldNo(String JavaDoc classPath, String JavaDoc fieldName)
185         throws JDOMetaDataUserException, JDOMetaDataFatalError
186     {
187         try {
188             timer.push("JDOMetaData.getFieldNo(String, String)",//NOI18N
189
"JDOMetaData.getFieldNo(" + classPath//NOI18N
190
+ ", " + fieldName + ")");//NOI18N
191
return delegate.getFieldNo(classPath, fieldName);
192         } finally {
193             timer.pop();
194         }
195     }
196
197     public String JavaDoc[] getManagedFields(String JavaDoc classPath)
198         throws JDOMetaDataUserException, JDOMetaDataFatalError
199     {
200         try {
201             timer.push("JDOMetaData.getPersistentFields(String)",//NOI18N
202
"JDOMetaData.getPersistentFields(" + classPath + ")");//NOI18N
203
return delegate.getManagedFields(classPath);
204         } finally {
205             timer.pop();
206         }
207     }
208 }
209
Popular Tags