View Javadoc

1   /*
2    * Copyright 2003,2004,2005 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.pluto.portlet.admin;
17  
18  
19  /***
20   * Base object that contains convenience logging methods.
21   *
22   * @author Craig Doremus
23   *
24   */
25  public class BaseAdminObject {
26  
27  	//Name of the subclass
28  	private String _className = null;
29  	//Identifier for the logging record
30  	private String _logId = null;
31  
32  	/***
33  	 * Default constructor.
34  	 *
35  	 */
36  	protected BaseAdminObject() {
37  	}
38  
39  	protected BaseAdminObject(String className) {
40  		_className = className;
41  	}
42  
43  	protected BaseAdminObject(String className, String logId) {
44  		_className = className;
45  		_logId = logId;
46  	}
47  
48  	protected void logMethodStart(String methodName) {
49  		PlutoAdminLogger.logMethodStart(_className, methodName);
50  	}
51  
52  	protected void logMethodEnd(String methodName) {
53  		PlutoAdminLogger.logMethodEnd(_className, methodName);
54  	}
55  
56  	protected void logMethodEnd(String methodName, Object retVal) {
57  		PlutoAdminLogger.logMethodEnd(_className, methodName, retVal);
58  	}
59  
60  	protected void logParam(String methodName, String paramName, Object paramVal) {
61  		PlutoAdminLogger.logParam(_className, methodName, paramName, paramVal);
62  	}
63  
64  	protected void logParam(String methodName, String paramName, int paramVal) {
65  		PlutoAdminLogger.logParam(_className, methodName, paramName, paramVal);
66  	}
67  
68  	protected void logParam(String methodName, String paramName, boolean paramVal) {
69  		PlutoAdminLogger.logParam(_className, methodName, paramName, paramVal);
70  	}
71  
72  	protected void logVar(String methodName, String varName, Object varVal) {
73  		PlutoAdminLogger.logParam(_className, methodName, varName, varVal);
74  	}
75  
76  	protected void logVar(String methodName, String varName, int varVal) {
77  		PlutoAdminLogger.logParam(_className, methodName, varName, varVal);
78  	}
79  
80  	protected void logVar(String methodName, String varName, boolean varVal) {
81  		PlutoAdminLogger.logParam(_className, methodName, varName, varVal);
82  	}
83  
84  	protected void logDebug(String methodName, String msg) {
85  		PlutoAdminLogger.logDebug(_className, methodName, msg);
86  	}
87  
88  	protected void logWarn(String methodName, String msg) {
89  		PlutoAdminLogger.logWarn(_className, methodName, msg);
90  	}
91  
92  	protected void logError(String methodName, String msg, Throwable e) {
93  		PlutoAdminLogger.logError(_className, methodName, msg, e);
94  	}
95  
96  	protected void logError(String methodName, Throwable e) {
97  		PlutoAdminLogger.logError(_className, methodName, e);
98  	}
99  }