org.onebusaway.container
Class ContainerLibrary

java.lang.Object
  extended by org.onebusaway.container.ContainerLibrary

public class ContainerLibrary
extends Object

Convenient methods for instantiating a ConfigurableApplicationContext Spring application container. For more details on the Spring application container, check out: http://www.springsource.org/

Author:
bdferris

Constructor Summary
ContainerLibrary()
           
 
Method Summary
static org.springframework.context.ConfigurableApplicationContext createContext(Iterable<String> paths)
          See createContext(Iterable, Map)
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.
static org.springframework.context.ConfigurableApplicationContext createContext(String... paths)
          See createContext(Iterable, Map)
static
<T> T
getBeanOfType(org.springframework.context.ApplicationContext context, Class<T> beanType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerLibrary

public ContainerLibrary()
Method Detail

createContext

public static org.springframework.context.ConfigurableApplicationContext createContext(String... paths)
See createContext(Iterable, Map)

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)
See createContext(Iterable, Map)

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 to specify a file-path resource or to specifically specify a classpath resource. A shutdown hook is automatically registered for the application context.

Parameters:
paths - resource paths
additionalBeans - 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)


Copyright © 2012 OneBusAway. All Rights Reserved.