01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.beans.factory.config;
18:
19: import java.lang.reflect.Constructor;
20:
21: import org.springframework.beans.BeansException;
22:
23: /**
24: * Extension of the {@link InstantiationAwareBeanPostProcessor} interface,
25: * adding a callback for predicting the eventual type of a processed bean.
26: *
27: * <p><b>NOTE:</b> This interface is a special purpose interface, mainly for
28: * internal use within the framework. In general, application-provided
29: * post-processors should simply implement the plain {@link BeanPostProcessor}
30: * interface or derive from the {@link InstantiationAwareBeanPostProcessorAdapter}
31: * class. New methods might be added to this interface even in point releases.
32: *
33: * @author Juergen Hoeller
34: * @since 2.0.3
35: * @see InstantiationAwareBeanPostProcessorAdapter
36: */
37: public interface SmartInstantiationAwareBeanPostProcessor extends
38: InstantiationAwareBeanPostProcessor {
39:
40: /**
41: * Predict the type of the bean to be eventually returned from this
42: * processor's {@link #postProcessBeforeInstantiation} callback.
43: * @param beanClass the raw class of the bean
44: * @param beanName the name of the bean
45: * @return the type of the bean, or <code>null</code> if not predictable
46: * @throws org.springframework.beans.BeansException in case of errors
47: */
48: Class predictBeanType(Class beanClass, String beanName)
49: throws BeansException;
50:
51: /**
52: * Determine the candidate constructors to use for the given bean.
53: * @param beanClass the raw class of the bean
54: * @param beanName the name of the bean
55: * @return the candidate constructors, or <code>null</code> if none specified
56: * @throws org.springframework.beans.BeansException in case of errors
57: */
58: Constructor[] determineCandidateConstructors(Class beanClass,
59: String beanName) throws BeansException;
60:
61: }
|