001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements. See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership. The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied. See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019
020 package org.apache.fulcrum.yaafi.service.advice;
021
022 /**
023 * Simple service providing interceptor advices for ordinary POJOs. Since the
024 * implementation uses Dynamic Proxies only methods invoked by an interface
025 * can be advised.
026 *
027 * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
028 */
029
030 public interface AdviceService
031 {
032 /**
033 * Is the given object already adviced?
034 * @param object the object to check
035 * @return true if the object is an dynamic proxy
036 */
037 boolean isAdviced(Object object);
038
039 /**
040 * Advice the object with a the list of default AvalonInterceptorServices.
041 * @param object the object to be advised
042 * @return the advised object
043 */
044 Object advice(Object object);
045
046 /**
047 * Advice the object with a the list of default AvalonInterceptorServices.
048 * @param name the name of the object
049 * @param object the object to be advised
050 * @return the advised object
051 */
052 Object advice(String name, Object object);
053
054 /**
055 * Advice the object with a list of AvalonInterceptorServices.
056 * @param object the object to be advised
057 * @param interceptorList the list of service names
058 * @return the advised object
059 */
060 Object advice(String[] interceptorList, Object object );
061
062 /**
063 * Advice the object with a list of AvalonInterceptorServices.
064 * @param name the associated name of the object
065 * @param object the object to be advised
066 * @param interceptorList the list of service names
067 * @return the advised object
068 */
069 Object advice(String name, String[] interceptorList, Object object);
070 }