/*
 * Copyright 2002-2006 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.beans.factory;

/**
 * Interface to be implemented by beans that wish to be aware of the bean class
 * loader, that is, the class loader used by the present bean factory to load
 * bean classes.
 *
 * <p>This is mainly intended to be implemented by framework classes which
 * have to pick up application classes by name despite themselves potentially
 * being loaded from a shared class loader.
 *
 * <p>For a list of all bean lifecycle methods, see the
 * {@link BeanFactory BeanFactory javadocs}.
 *
 * @author Juergen Hoeller
 * @since 2.0
 * @see BeanNameAware
 * @see BeanFactoryAware
 * @see InitializingBean
 */
public interface BeanClassLoaderAware {

	/**
	 * Callback that supplies the bean class loader to a bean instance.
	 * <p>Invoked after population of normal bean properties but before an init
	 * callback like InitializingBean's <code>afterPropertiesSet</code> or a
	 * custom init-method.
	 * @param classLoader owning class loader (may be <code>null</code> in
	 * case of the caller class loader to be used)
	 */
	void setBeanClassLoader(ClassLoader classLoader);

}

@@ -670,54 +670,35 @@
 %0A * 
-Interface to be implemented by beans that wish
+Callback that allows a bean
  to 
@@ -721,25 +721,45 @@
 bean
+%0A * %7B@link ClassLoader
  class
-%0A *
  loader
-,
+%7D;
  tha
@@ -792,16 +792,19 @@
 d by the
+%0A *
  present
@@ -824,19 +824,16 @@
  to load
-%0A *
  bean cl
@@ -1341,24 +1341,43 @@
 es the bean 
+%7B@link ClassLoader 
 class loader
@@ -1376,19 +1376,24 @@
 s loader
+%7D
  to
+%0A%09 *
  a bean 
@@ -1417,21 +1417,32 @@
 Invoked 
+%3Ci%3E
 after
+%3C/i%3E the
  populat
@@ -1478,23 +1478,34 @@
  but
- 
+%0A%09 * %3Ci%3E
 before
+%3C/i%3E
  an init
 %0A%09 *
@@ -1504,52 +1504,180 @@
 init
-%0A%09 * callback like InitializingBean's %3Ccode%3E
+ialization callback such as%0A%09 * %7B@link org.springframework.beans.factory.InitializingBean InitializingBean's%7D%0A%09 * %7B@link org.springframework.beans.factory.InitializingBean#
 afte
@@ -1694,24 +1694,27 @@
 sSet
-%3C/code%3E
+()%7D%0A%09 * method
  or a
-%0A%09 *
  cus
@@ -1753,16 +1753,20 @@
 sLoader 
+the 
 owning c
@@ -1776,18 +1776,18 @@
 s loader
+;
  
-(
 may be %3C
@@ -1814,51 +1814,197 @@
 %09 * 
-case of the caller c
+which case a default %3Ccode%3EClassLoader%3C/code%3E must be used, for example%0A%09 * the %3Ccode%3EC
 lass
- l
+L
 oader
- to be used)
+%3C/code%3E obtained via%0A%09 * %7B@link org.springframework.util.ClassUtils#getDefaultClassLoader()%7D
 %0A%09 *

Clarified the contract in the javadoc.