org.eclipse.stardust.engine.api.spring
Class SpringUtils

java.lang.Object
  extended by org.eclipse.stardust.engine.api.spring.SpringUtils

public class SpringUtils
extends Object

This class provides methods to obtain the Spring Application Context, to cache a Spring Application Context, to clear the cache and to obtain the Spring Web Application Context.


Constructor Summary
SpringUtils()
           
 
Method Summary
static org.springframework.context.ApplicationContext getApplicationContext()
          Returns the cached Spring Application Context for retrieving bean instances specified in carnot-spring-context.xml.
static org.springframework.context.ApplicationContext getWebApplicationContext()
          Finds the root web application context for this web application for the servlet context or for the current thread.
static void reset()
          Removes the stored Spring Application Context from cache.
static void setApplicationContext(org.springframework.context.ConfigurableApplicationContext ctxt)
          Sets the specified Spring Application Context that has to be cached.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringUtils

public SpringUtils()
Method Detail

getApplicationContext

public static org.springframework.context.ApplicationContext getApplicationContext()
Returns the cached Spring Application Context for retrieving bean instances specified in carnot-spring-context.xml. If no cached application context is available a new one is bootstrapped.

Returns:
ApplicationContext containing Spring Beans

setApplicationContext

public static void setApplicationContext(org.springframework.context.ConfigurableApplicationContext ctxt)
Sets the specified Spring Application Context that has to be cached.

Parameters:
ctxt - The Spring Application Context to be cached.

reset

public static void reset()
Removes the stored Spring Application Context from cache.


getWebApplicationContext

public static org.springframework.context.ApplicationContext getWebApplicationContext()
Finds the root web application context for this web application for the servlet context or for the current thread.

Returns:
The root web ApplicationContext, or null if none found.


Copyright © 2017 Eclipse Stardust. All Rights Reserved.