01: /*
02: * Copyright 2002-2006 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.unitils.spring.util;
18:
19: import org.springframework.context.ConfigurableApplicationContext;
20:
21: import java.util.List;
22:
23: /**
24: * Factory for creating Spring <code>ApplicationContext</code>s.
25: *
26: * @author Tim Ducheyne
27: * @author Filip Neven
28: */
29: public interface ApplicationContextFactory {
30:
31: /**
32: * Create an <code>ApplicationContext</code>, in which the complete list of the given resources is loaded. The way in
33: * which these locations are interpreted depends on the concrete implementation of the interface. More in particular,
34: * the returned instance is an instance of <code>ConfigurableApplicationContext</code>, that is not yet <i>refreshed</i>,
35: * i.e. the method <code>ConfigurableApplicationContext.refresh()</code> has neither been called explicitly, nor
36: * implicitly by invoking a constructor that also makes sure the configuration is processed by calling the <code>refresh</code>
37: * method.
38: *
39: * @param locations The configuration file locations, not null
40: * @return A <code>ConfigurableApplicationContext</code>, on which the <code>refresh()</code> method hasn't been called yet
41: */
42: ConfigurableApplicationContext createApplicationContext(
43: List<String> locations);
44:
45: }
|