Package ubic.gemma.persistence.util
Class SpringContextUtil
- java.lang.Object
-
- ubic.gemma.persistence.util.SpringContextUtil
-
public class SpringContextUtil extends Object
Methods to create Spring contexts for Gemma manually. This is meant to be used by CLIs only.- Author:
- pavlidis
-
-
Constructor Summary
Constructors Constructor Description SpringContextUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ApplicationContextgetApplicationContext(boolean testing, boolean isWebApp, String[] additionalConfigurationLocations)Deprecated.this method does not support producing Gemma Web contexts, please migrate existing code to usegetApplicationContext(String[], String...)instead.static ApplicationContextgetApplicationContext(String[] activeProfiles, String... additionalConfigurationLocations)Obtain an application context for Gemma.static voidprepareContext(ApplicationContext context)Prepare a given context for prime time.
-
-
-
Method Detail
-
getApplicationContext
public static ApplicationContext getApplicationContext(String[] activeProfiles, String... additionalConfigurationLocations) throws BeansException
Obtain an application context for Gemma.- Parameters:
activeProfiles- list of active profiles, for testing useSpringProfiles.TESTadditionalConfigurationLocations- a list of additional configuration location to load beans from- Returns:
- a fully initialized
ApplicationContext - Throws:
BeansException- if the creation of the context fails
-
getApplicationContext
@Deprecated public static ApplicationContext getApplicationContext(boolean testing, boolean isWebApp, String[] additionalConfigurationLocations) throws BeansException
Deprecated.this method does not support producing Gemma Web contexts, please migrate existing code to usegetApplicationContext(String[], String...)instead.- Parameters:
isWebApp- If true, aUnsupportedOperationExceptionwill be raised since retrieving the Web application context is not supported from here. Use WebApplicationContextUtils.getWebApplicationContext() instead. This is only kept for backward-compatibility with external scripts.- Throws:
BeansException- See Also:
getApplicationContext(String[], String...)
-
prepareContext
public static void prepareContext(ApplicationContext context)
Prepare a given context for prime time.Perform the following steps:
- activate the
devprofile as a fallback if no profile are active - log an informative message with the context version and active profiles
- activate the
-
-