org.unitils.spring.util.ApplicationContextFactory Maven / Gradle / Ivy
/*
* 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.unitils.spring.util;
import org.springframework.context.ConfigurableApplicationContext;
import java.util.List;
/**
* Factory for creating Spring ApplicationContext
s.
*
* @author Tim Ducheyne
* @author Filip Neven
*/
public interface ApplicationContextFactory {
/**
* Create an ApplicationContext
, in which the complete list of the given resources is loaded. The way in
* which these locations are interpreted depends on the concrete implementation of the interface. More in particular,
* the returned instance is an instance of ConfigurableApplicationContext
, that is not yet refreshed,
* i.e. the method ConfigurableApplicationContext.refresh()
has neither been called explicitly, nor
* implicitly by invoking a constructor that also makes sure the configuration is processed by calling the refresh
* method.
*
* @param locations The configuration file locations, not null
* @return A ConfigurableApplicationContext
, on which the refresh()
method hasn't been called yet
*/
ConfigurableApplicationContext createApplicationContext(List locations);
}