01: package com.tagtraum.jo;
02:
03: import com.tagtraum.framework.log.Log;
04: import com.tagtraum.framework.log.C_Log;
05:
06: /**
07: *
08: * @author <a href="mailto:hs@tagtraum.com">Hendrik Schreiber</a>
09: * @version 1.1beta1 $Id: BaseRequestInterceptor.java,v 1.3 2003/07/10 00:52:32 hendriks73 Exp $
10: */
11: public abstract class BaseRequestInterceptor implements
12: RequestInterceptor {
13: private RequestInterceptorConfig config;
14: private Log log;
15: private String logPrefix;
16:
17: public final void init(RequestInterceptorConfig config)
18: throws InterceptorException {
19: this .config = config;
20: this .log = Log.getLog(config.getService().getName());
21: this .logPrefix = "[" + config.getName() + "]: ";
22: this .log.log(logPrefix + "init", C_Log.MODULE);
23: init();
24: }
25:
26: public void init() throws InterceptorException {
27: }
28:
29: public I_JoServletService getService() {
30: return config.getService();
31: }
32:
33: public RequestInterceptorConfig getConfig() {
34: return config;
35: }
36:
37: public Log getLog() {
38: return log;
39: }
40:
41: public void log(String message, int level) {
42: log.log(logPrefix + message, level);
43: }
44:
45: public void log(String message) {
46: log.log(logPrefix + message, C_Log.MODULE);
47: }
48:
49: public void destroy() {
50: this .log.log(logPrefix + "destroy", C_Log.MODULE);
51: }
52:
53: }
|