View Javadoc

1   /*
2    * Copyright 2006-2008 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
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.osgi.context.support;
18  
19  import org.springframework.beans.factory.BeanClassLoaderAware;
20  import org.springframework.context.ApplicationContextAware;
21  import org.springframework.core.io.ResourceLoader;
22  
23  /**
24   * Strategy interface for plugging various thread context class loaders during
25   * an OSGi application context critical life cycle events.
26   * 
27   * @see Thread#getContextClassLoader()
28   * @see AbstractDelegatedExecutionApplicationContext
29   * @see ResourceLoader#getClassLoader()
30   * @see BeanClassLoaderAware
31   * @see ApplicationContextAware
32   * 
33   * @author Costin Leau
34   */
35  public interface ContextClassLoaderProvider {
36  
37  	/**
38  	 * Returns the context class loader to be used by the OSGi application
39  	 * context during its life cycle events.
40  	 * 
41  	 * @return class loader used as a thread context class loader
42  	 */
43  	ClassLoader getContextClassLoader();
44  }