KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > services > diag > DiagnosticableGeneric


1 /*
2
3    Derby - Class org.apache.derby.iapi.services.diag.DiagnosticableGeneric
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.services.diag;
23
24 import org.apache.derby.iapi.error.StandardException;
25
26 import java.util.Properties JavaDoc;
27
28 /**
29
30   The Diagnosticable class implements the Diagnostics protocol, and can
31   be used as the parent class for all other Diagnosticable objects.
32
33 **/

34
35 public class DiagnosticableGeneric implements Diagnosticable
36 {
37     /*
38     ** Fields of Diagnosticable
39     */

40     protected Object JavaDoc diag_object = null;
41
42    
43     public DiagnosticableGeneric()
44     {
45     }
46
47     /*
48     ** Methods of Diagnosticable
49     */

50     public void init(Object JavaDoc obj)
51     {
52         // This is the pointer to the instance of the object to work on.
53
this.diag_object = obj;
54     }
55
56     /**
57      * Default implementation of diagnostic on the object.
58      * <p>
59      * This routine returns a string with whatever diagnostic information
60      * you would like to provide about this object.
61      * <p>
62      * This routine should be overriden by a real implementation of the
63      * diagnostic information you would like to provide.
64      * <p>
65      *
66      * @return A string with diagnostic information about the object.
67      *
68      * @exception StandardException Standard exception policy.
69      **/

70     public String JavaDoc diag()
71         throws StandardException
72     {
73         return(diag_object.toString());
74     }
75
76     /**
77      * Default implementation of detail diagnostic on the object.
78      * <p>
79      * This routine should be overriden if there is detail diagnostics to
80      * be provided by a real implementation.
81      * <p>
82      *
83      * @exception StandardException Standard exception policy.
84      **/

85     public void diag_detail(Properties JavaDoc prop)
86         throws StandardException
87     {
88         return;
89     }
90 }
91
Popular Tags