001/** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.xbean.spring.context; 018 019import org.springframework.beans.factory.DisposableBean; 020import org.springframework.context.ConfigurableApplicationContext; 021import org.springframework.core.io.ClassPathResource; 022import org.springframework.core.io.ResourceLoader; 023 024import java.util.List; 025 026/** 027 * SpringApplicationContext is an interface that defines the actual interface exposed by the application contexts 028 * provided by Spring. This interface should be in Spring and the Spring application contexts should implement this 029 * interface. 030 * 031 * @author Dain Sundstrom 032 * @version $Id$ 033 * @since 2.0 034 */ 035public interface SpringApplicationContext extends ConfigurableApplicationContext, DisposableBean, ResourceLoader{ 036 /** 037 * Set a friendly name for this context. 038 * Typically done during initialization of concrete context implementations. 039 * @param displayName the display name for the context 040 */ 041 void setDisplayName(String displayName); 042 043 /** 044 * Gets the list of BeanPostProcessors that will get applied 045 * to beans created with this factory. 046 * @return the list of BeanPostProcessors that will get applied 047 * to beans created with this factory 048 */ 049 List getBeanFactoryPostProcessors(); 050 051 /** 052 * Specify the ClassLoader to load class path resources with, 053 * or <code>null</code> if using the thread context class loader on actual access 054 * (applying to the thread that does ClassPathResource calls). 055 * <p>The default is that ClassLoader access will happen via the thread 056 * context class loader on actual access (applying to the thread that 057 * does ClassPathResource calls). 058 * @param classLoader the ClassLoader to load class path resources 059 */ 060 void setClassLoader(ClassLoader classLoader); 061 062 /** 063 * Return the ClassLoader to load class path resources with, 064 * or <code>null</code> if using the thread context class loader on actual access 065 * (applying to the thread that does ClassPathResource calls). 066 * <p>Will get passed to ClassPathResource's constructor for all 067 * ClassPathResource objects created by this resource loader. 068 * 069 * @return the ClassLoader to load class path resources 070 * @see ClassPathResource 071 */ 072 ClassLoader getClassLoader(); 073}