org.shept.util
public class SpringApplicationContextHolder extends Object implements org.springframework.context.ApplicationContextAware
In applicationContext.xml we just need a reference to self to make it work seamlessly
**** NOTE ***************************************************************************
Use this with caution as this approach is limited to one ApplicationContext per JVM !
As a workaround we might use a ThreadLocale for holding the context or
we might want to copy and rename this class for each individual use case,
e.g. MyAppContextHolder
**** NOTE ***************************************************************************| Modifier and Type | Field and Description |
|---|---|
private static org.springframework.context.ApplicationContext |
CONTEXT |
| Constructor and Description |
|---|
SpringApplicationContextHolder() |
| Modifier and Type | Method and Description |
|---|---|
static org.springframework.context.ApplicationContext |
getContext() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic static org.springframework.context.ApplicationContext getContext()
Copyright © 2014. All Rights Reserved.