001/*
002 * Copyright 2002-2012 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.aop;
018
019import org.aopalliance.aop.Advice;
020
021/**
022 * Subinterface of AOP Alliance Advice that allows additional interfaces
023 * to be implemented by an Advice, and available via a proxy using that
024 * interceptor. This is a fundamental AOP concept called <b>introduction</b>.
025 *
026 * <p>Introductions are often <b>mixins</b>, enabling the building of composite
027 * objects that can achieve many of the goals of multiple inheritance in Java.
028 *
029 * <p>Compared to {qlink IntroductionInfo}, this interface allows an advice to
030 * implement a range of interfaces that is not necessarily known in advance.
031 * Thus an {@link IntroductionAdvisor} can be used to specify which interfaces
032 * will be exposed in an advised object.
033 *
034 * @author Rod Johnson
035 * @since 1.1.1
036 * @see IntroductionInfo
037 * @see IntroductionAdvisor
038 */
039public interface DynamicIntroductionAdvice extends Advice {
040
041        /**
042         * Does this introduction advice implement the given interface?
043         * @param intf the interface to check
044         * @return whether the advice implements the specified interface
045         */
046        boolean implementsInterface(Class<?> intf);
047
048}