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.beans.factory.wiring; 018 019import org.springframework.lang.Nullable; 020 021/** 022 * Strategy interface to be implemented by objects than can resolve bean name 023 * information, given a newly instantiated bean object. Invocations to the 024 * {@link #resolveWiringInfo} method on this interface will be driven by 025 * the AspectJ pointcut in the relevant concrete aspect. 026 * 027 * <p>Metadata resolution strategy can be pluggable. A good default is 028 * {@link ClassNameBeanWiringInfoResolver}, which uses the fully-qualified 029 * class name as bean name. 030 * 031 * @author Rod Johnson 032 * @since 2.0 033 * @see BeanWiringInfo 034 * @see ClassNameBeanWiringInfoResolver 035 * @see org.springframework.beans.factory.annotation.AnnotationBeanWiringInfoResolver 036 */ 037public interface BeanWiringInfoResolver { 038 039 /** 040 * Resolve the BeanWiringInfo for the given bean instance. 041 * @param beanInstance the bean instance to resolve info for 042 * @return the BeanWiringInfo, or {@code null} if not found 043 */ 044 @Nullable 045 BeanWiringInfo resolveWiringInfo(Object beanInstance); 046 047}