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.framework;
018
019/**
020 * Interface to be implemented by factories that are able to create
021 * AOP proxies based on {@link AdvisedSupport} configuration objects.
022 *
023 * <p>Proxies should observe the following contract:
024 * <ul>
025 * <li>They should implement all interfaces that the configuration
026 * indicates should be proxied.
027 * <li>They should implement the {@link Advised} interface.
028 * <li>They should implement the equals method to compare proxied
029 * interfaces, advice, and target.
030 * <li>They should be serializable if all advisors and target
031 * are serializable.
032 * <li>They should be thread-safe if advisors and target
033 * are thread-safe.
034 * </ul>
035 *
036 * <p>Proxies may or may not allow advice changes to be made.
037 * If they do not permit advice changes (for example, because
038 * the configuration was frozen) a proxy should throw an
039 * {@link AopConfigException} on an attempted advice change.
040 *
041 * @author Rod Johnson
042 * @author Juergen Hoeller
043 */
044public interface AopProxyFactory {
045
046        /**
047         * Create an {@link AopProxy} for the given AOP configuration.
048         * @param config the AOP configuration in the form of an
049         * AdvisedSupport object
050         * @return the corresponding AOP proxy
051         * @throws AopConfigException if the configuration is invalid
052         */
053        AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException;
054
055}