Class RestInitializeContext
java.lang.Object
ubic.gemma.rest.context.RestInitializeContext
- All Implemented Interfaces:
org.springframework.context.ApplicationContextInitializer<org.springframework.web.context.ConfigurableWebApplicationContext>
public class RestInitializeContext
extends Object
implements org.springframework.context.ApplicationContextInitializer<org.springframework.web.context.ConfigurableWebApplicationContext>
Standalone gemma-rest counterpart to
ubic.gemma.web.context.InitializeContext (which lives in
gemma-web and pulls in JSP / theme / servlet-context configuration that the REST WAR has no use for).
Responsibilities reduced to what the standalone gemma-rest.war actually needs:
- Activate the
webSpring profile so beans gated on@Profile("web")(notablyAnalyticsConfig, registered viaapplicationContext-analytics.xml) become active. The profile name is kept aswebrather than introducing a freshrestprofile so existing@Profile("web")call sites in gemma-rest do not need re-gating. - Delegate to
SpringContextUtils.prepareContext(ApplicationContext)for the environment-profile-validation +SecurityContextHolderstrategy work that every Gemma context needs.
Wired in gemma-rest/src/main/webapp/WEB-INF/web.xml via:
<context-param>
<param-name>contextInitializerClasses</param-name>
<param-value>ubic.gemma.rest.context.RestInitializeContext</param-value>
</context-param>
Compare ubic.gemma.web.context.InitializeContext, gemma-web's full-fat equivalent (kept in place for the
legacy UI's lifecycle; both classes co-exist during the gemma-web → gemma-rest cutover).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext)
-
Constructor Details
-
RestInitializeContext
public RestInitializeContext()
-
-
Method Details
-
initialize
public void initialize(org.springframework.web.context.ConfigurableWebApplicationContext applicationContext) - Specified by:
initializein interfaceorg.springframework.context.ApplicationContextInitializer<org.springframework.web.context.ConfigurableWebApplicationContext>
-