001/*
002 * Copyright 2002-2016 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.core;
018
019/**
020 * Interface to be implemented by decorating proxies, in particular Spring AOP
021 * proxies but potentially also custom proxies with decorator semantics.
022 *
023 * <p>Note that this interface should just be implemented if the decorated class
024 * is not within the hierarchy of the proxy class to begin with. In particular,
025 * a "target-class" proxy such as a Spring AOP CGLIB proxy should not implement
026 * it since any lookup on the target class can simply be performed on the proxy
027 * class there anyway.
028 *
029 * <p>Defined in the core module in order to allow
030 * #{@link org.springframework.core.annotation.AnnotationAwareOrderComparator}
031 * (and potential other candidates without spring-aop dependencies) to use it
032 * for introspection purposes, in particular annotation lookups.
033 *
034 * @author Juergen Hoeller
035 * @since 4.3
036 */
037public interface DecoratingProxy {
038
039        /**
040         * Return the (ultimate) decorated class behind this proxy.
041         * <p>In case of an AOP proxy, this will be the ultimate target class,
042         * not just the immediate target (in case of multiple nested proxies).
043         * @return the decorated class (never {@code null})
044         */
045        Class<?> getDecoratedClass();
046
047}