01: /*
02:
03: Derby - Class org.apache.derby.iapi.services.diag.DiagnosticableGeneric
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (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;
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: ** Fields of Diagnosticable
38: */
39: protected Object diag_object = null;
40:
41: public DiagnosticableGeneric() {
42: }
43:
44: /*
45: ** Methods of Diagnosticable
46: */
47: public void init(Object obj) {
48: // This is the pointer to the instance of the object to work on.
49: this .diag_object = obj;
50: }
51:
52: /**
53: * Default implementation of diagnostic on the object.
54: * <p>
55: * This routine returns a string with whatever diagnostic information
56: * you would like to provide about this object.
57: * <p>
58: * This routine should be overriden by a real implementation of the
59: * diagnostic information you would like to provide.
60: * <p>
61: *
62: * @return A string with diagnostic information about the object.
63: *
64: * @exception StandardException Standard exception policy.
65: **/
66: public String diag() throws StandardException {
67: return (diag_object.toString());
68: }
69:
70: /**
71: * Default implementation of detail diagnostic on the object.
72: * <p>
73: * This routine should be overriden if there is detail diagnostics to
74: * be provided by a real implementation.
75: * <p>
76: *
77: * @exception StandardException Standard exception policy.
78: **/
79: public void diag_detail(Properties prop) throws StandardException {
80: return;
81: }
82: }
|