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.autoproxy;
018
019import org.springframework.aop.TargetSource;
020
021/**
022 * Implementations can create special target sources, such as pooling target
023 * sources, for particular beans. For example, they may base their choice
024 * on attributes, such as a pooling attribute, on the target class.
025 *
026 * <p>AbstractAutoProxyCreator can support a number of TargetSourceCreators,
027 * which will be applied in order.
028 *
029 * @author Rod Johnson
030 * @author Juergen Hoeller
031 */
032public interface TargetSourceCreator {
033
034        /**
035         * Create a special TargetSource for the given bean, if any.
036         * @param beanClass the class of the bean to create a TargetSource for
037         * @param beanName the name of the bean
038         * @return a special TargetSource or {@code null} if this TargetSourceCreator isn't
039         * interested in the particular bean
040         */
041        TargetSource getTargetSource(Class<?> beanClass, String beanName);
042
043}