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;
29  
30  	/***
31  	 * Default constructor.
32  	 *
33  	 */
34  	protected BaseAdminObject() {
35  	}
36  
37  	protected BaseAdminObject(String className) {
38  		_className = className;
39  	}
40  
41  	protected BaseAdminObject(String className, String logId) {
42  		_className = className;
43  	}
44  
45  	protected void logMethodStart(String methodName) {
46  		PlutoAdminLogger.logMethodStart(_className, methodName);
47  	}
48  
49  	protected void logMethodEnd(String methodName) {
50  		PlutoAdminLogger.logMethodEnd(_className, methodName);
51  	}
52  
53  	protected void logMethodEnd(String methodName, Object retVal) {
54  		PlutoAdminLogger.logMethodEnd(_className, methodName, retVal);
55  	}
56  
57  	protected void logParam(String methodName, String paramName, Object paramVal) {
58  		PlutoAdminLogger.logParam(_className, methodName, paramName, paramVal);
59  	}
60  
61  	protected void logParam(String methodName, String paramName, int paramVal) {
62  		PlutoAdminLogger.logParam(_className, methodName, paramName, paramVal);
63  	}
64  
65  	protected void logParam(String methodName, String paramName, boolean paramVal) {
66  		PlutoAdminLogger.logParam(_className, methodName, paramName, paramVal);
67  	}
68  
69  	protected void logVar(String methodName, String varName, Object varVal) {
70  		PlutoAdminLogger.logParam(_className, methodName, varName, varVal);
71  	}
72  
73  	protected void logVar(String methodName, String varName, int varVal) {
74  		PlutoAdminLogger.logParam(_className, methodName, varName, varVal);
75  	}
76  
77  	protected void logVar(String methodName, String varName, boolean varVal) {
78  		PlutoAdminLogger.logParam(_className, methodName, varName, varVal);
79  	}
80  
81  	protected void logDebug(String methodName, String msg) {
82  		PlutoAdminLogger.logDebug(_className, methodName, msg);
83  	}
84  
85  	protected void logWarn(String methodName, String msg) {
86  		PlutoAdminLogger.logWarn(_className, methodName, msg);
87  	}
88  
89  	protected void logError(String methodName, String msg, Throwable e) {
90  		PlutoAdminLogger.logError(_className, methodName, msg, e);
91  	}
92  
93  	protected void logError(String methodName, Throwable e) {
94  		PlutoAdminLogger.logError(_className, methodName, e);
95  	}
96  }