01: // Copyright 2006 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry.ioc.services;
16:
17: import org.apache.commons.logging.Log;
18:
19: /**
20: * Service that can create a logging interceptor that wraps around a service implementation (or
21: * interceptor). The interceptor works with the service's log to log, at debug level, method entry
22: * (with arguments), method exit (with return value, if any) as well as any thrown exceptions.
23: *
24: *
25: */
26: public interface LoggingDecorator {
27: /**
28: * Builds a logging interceptor instance.
29: *
30: * @param <T>
31: * @param serviceInterface
32: * interface implemented by the delegate
33: * @param delegate
34: * existing object to be wrapped
35: * @param serviceId
36: * id of service
37: * @param serviceLog
38: * log used for debug level logging messages by the interceptor
39: * @return a new object implementing the interface that can be used in place of the delegate,
40: * providing logging behavior around each method call on the service interface
41: */
42: <T> T build(Class<T> serviceInterface, T delegate,
43: String serviceId, Log serviceLog);
44: }
|