Package org.onebusaway.container
Class ContainerLibrary
- java.lang.Object
-
- org.onebusaway.container.ContainerLibrary
-
public class ContainerLibrary extends Object
Convenient methods for instantiating aConfigurableApplicationContextSpring application container. For more details on the Spring application container, check out: http://www.springsource.org/- Author:
- bdferris
-
-
Constructor Summary
Constructors Constructor Description ContainerLibrary()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.springframework.context.ConfigurableApplicationContextcreateContext(Iterable<String> paths)static org.springframework.context.ConfigurableApplicationContextcreateContext(Iterable<String> paths, Map<String,org.springframework.beans.factory.config.BeanDefinition> additionalBeans)Construct and instantiate a Spring application container from the specified resources.static org.springframework.context.ConfigurableApplicationContextcreateContext(String... paths)static <T> TgetBeanOfType(org.springframework.context.ApplicationContext context, Class<T> beanType)
-
-
-
Method Detail
-
createContext
public static org.springframework.context.ConfigurableApplicationContext createContext(String... paths)
- Parameters:
paths- resource paths- Returns:
- a Spring application container context created from the specified resources
-
createContext
public static org.springframework.context.ConfigurableApplicationContext createContext(Iterable<String> paths)
- Parameters:
paths- resource paths- Returns:
- a Spring application container context created from the specified resources
-
createContext
public static org.springframework.context.ConfigurableApplicationContext createContext(Iterable<String> paths, Map<String,org.springframework.beans.factory.config.BeanDefinition> additionalBeans)
Construct and instantiate a Spring application container from the specified resources. By default, paths are treated as references to classpath resources, but you can prefix with "file:" to specify a file-path resource or "classpath:" to specifically specify a classpath resource. A shutdown hook is automatically registered for the application context.- Parameters:
paths- resource pathsadditionalBeans- additional bean defintions to include in the context- Returns:
- a Spring application container context
-
getBeanOfType
public static <T> T getBeanOfType(org.springframework.context.ApplicationContext context, Class<T> beanType)
-
-