| org.unitils.spring.util.ApplicationContextManager
ApplicationContextManager | public class ApplicationContextManager extends AnnotatedInstanceManager (Code) | | A class for managing and creating Spring application contexts.
todo javadoc
author: Tim Ducheyne author: Filip Neven |
beanPostProcessorTypes | protected List<Class<? extends BeanPostProcessor>> beanPostProcessorTypes(Code) | | List of registered BeanPostProcessor types. For each ApplicationContext that is created, a BeanPostProcessor of
each of these types is associated with the ApplicationContext
|
beanPostProcessors | protected Map<ApplicationContext, Map<Class<? extends BeanPostProcessor>, BeanPostProcessor>> beanPostProcessors(Code) | | |
ApplicationContextManager | public ApplicationContextManager(ApplicationContextFactory applicationContextFactory)(Code) | | Creates a new instance, using the given
ApplicationContextFactory . The given list of
BeanPostProcessor s will be registered on all ApplicationContext s that are
created.
Parameters: applicationContextFactory - The factory for creating ApplicationContext s, not null. |
addBeanPostProcessorType | public void addBeanPostProcessorType(Class<? extends BeanPostProcessor> beanPostProcessorType)(Code) | | |
createInstanceForValues | protected ApplicationContext createInstanceForValues(List<String> locations)(Code) | | Creates a new application context for the given locations. The application context factory is used to create
the instance. After creating the context, this will also register all BeanPostProcessor s and
refresh the context.
Note: for this to work, the application context may not have been refreshed in the factory.
By registering the bean post processors before the refresh, we can intercept bean creation and bean wiring.
This is no longer possible if the context is already refreshed.
Parameters: locations - The locations where to find configuration files, not null the context, not null |
getAnnotationValues | protected List<String> getAnnotationValues(SpringApplicationContext annotation)(Code) | | Gets the locations that are specified for the given
SpringApplicationContext annotation. An array with
1 empty string should be considered to be empty and null should be returned.
Parameters: annotation - The annotation, not null The locations, null if no values were specified |
getApplicationContext | public ApplicationContext getApplicationContext(Object testObject)(Code) | | Gets the application context for the given test as described in the class javadoc. A UnitilsException will be
thrown if no context could be retrieved or created.
Parameters: testObject - The test instance, not null The application context, not null |
getBeanPostProcessor | public T getBeanPostProcessor(ApplicationContext applicationContext, Class<T> beanPostProcessorType)(Code) | | |
hasApplicationContext | public boolean hasApplicationContext(Object testObject)(Code) | | Checks whether the given test object has an application context linked to it. If true is returned,
ApplicationContextManager.getApplicationContext will return an application context, If false is returned, it will raise
an exception.
Parameters: testObject - The test instance, not null True if an application context is linked |
invalidateApplicationContext | public void invalidateApplicationContext(Class>... classes)(Code) | | Forces the reloading of the application context the next time that it is requested. If classes are given
only contexts that are linked to those classes will be reset. If no classes are given, all cached
contexts will be reset.
Parameters: classes - The classes for which to reset the contexts |
registerBeanPostProcessor | protected void registerBeanPostProcessor(ConfigurableApplicationContext applicationContext, Class<? extends BeanPostProcessor> beanPostProcessorType, BeanPostProcessor beanPostProcessor)(Code) | | |
|
|