View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.fulcrum.yaafi.service.advice;
21  
22  /**
23   * Simple service providing interceptor advices for ordinary POJOs. Since the
24   * implementation uses Dynamic Proxies only methods invoked by an interface
25   * can be advised.
26   *
27   * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
28   */
29  
30  public interface AdviceService
31  {
32      /**
33       * Is the given object already adviced?
34       * @param object the object to check
35       * @return true if the object is an dynamic proxy
36       */
37      boolean isAdviced(Object object);
38  
39      /**
40       * Advice the object with a the list of default AvalonInterceptorServices.
41       * @param object the object to be advised
42       * @return the advised object
43       */
44      Object advice(Object object);
45  
46      /**
47       * Advice the object with a the list of default AvalonInterceptorServices.
48       * @param name the name of the object
49       * @param object the object to be advised
50       * @return the advised object
51       */
52      Object advice(String name, Object object);
53  
54      /**
55       * Advice the object with a list of AvalonInterceptorServices.
56       * @param object the object to be advised
57       * @param interceptorList the list of service names
58       * @return the advised object
59       */
60      Object advice(String[] interceptorList, Object object );
61  
62      /**
63       * Advice the object with a list of AvalonInterceptorServices.
64       * @param name the associated name of the object
65       * @param object the object to be advised
66       * @param interceptorList the list of service names
67       * @return the advised object
68       */
69      Object advice(String name, String[] interceptorList, Object object);
70  }