|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.opensymphony.xwork2.ObjectFactory siouxsie.mvc.spring.SpringObjectFactory
public class SpringObjectFactory
static Spring object factory. The application context must be assigned statically before the factory is used. Static init is nasty but allows easy sharing of application contexts. If the MVC app is standalone, prefer the XW spring object factory and set the XML files path via the XW container. Code mainly taken from XW 2.1.
Field Summary | |
---|---|
protected static org.springframework.context.ApplicationContext |
APP_CONTEXT
|
protected int |
autowireStrategy
|
protected static org.springframework.beans.factory.config.AutowireCapableBeanFactory |
autoWiringFactory
|
Fields inherited from class com.opensymphony.xwork2.ObjectFactory |
---|
reflectionProvider |
Constructor Summary | |
---|---|
SpringObjectFactory()
|
Method Summary | |
---|---|
java.lang.Object |
autoWireBean(java.lang.Object bean)
|
java.lang.Object |
autoWireBean(java.lang.Object bean,
org.springframework.beans.factory.config.AutowireCapableBeanFactory autoWiringFactory)
|
java.lang.Object |
buildBean(java.lang.Class clazz,
java.util.Map extraContext)
|
java.lang.Object |
buildBean(java.lang.String beanName,
java.util.Map extraContext,
boolean injectInternal)
Looks up beans using Spring's application context before falling back to the method defined in the ObjectFactory . |
protected static org.springframework.beans.factory.config.AutowireCapableBeanFactory |
findAutoWiringBeanFactory(org.springframework.context.ApplicationContext context)
If the given context is assignable to AutowireCapbleBeanFactory or contains a parent or a factory that is, then set the autoWiringFactory appropriately. |
int |
getAutowireStrategy()
|
java.lang.Class |
getClassInstance(java.lang.String className)
|
boolean |
isNoArgConstructorRequired()
Allows for ObjectFactory implementations that support Actions without no-arg constructors. |
static void |
setApplicationContext(org.springframework.context.ApplicationContext appContext)
Set the Spring ApplicationContext that should be used to look beans up with. |
void |
setAutowireStrategy(int autowireStrategy)
Sets the autowiring strategy |
void |
setUseClassCache(boolean useClassCache)
Enable / disable caching of classes loaded by Spring. |
Methods inherited from class com.opensymphony.xwork2.ObjectFactory |
---|
buildAction, buildBean, buildInterceptor, buildResult, buildValidator, getObjectFactory, injectInternalBeans, setClassLoader, setContainer, setReflectionProvider |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.springframework.context.ApplicationContext APP_CONTEXT
protected static org.springframework.beans.factory.config.AutowireCapableBeanFactory autoWiringFactory
protected int autowireStrategy
Constructor Detail |
---|
public SpringObjectFactory()
Method Detail |
---|
public static void setApplicationContext(org.springframework.context.ApplicationContext appContext) throws org.springframework.beans.BeansException
appContext
- The Spring ApplicationContext that should be used to look beans up with.
org.springframework.beans.BeansException
public void setAutowireStrategy(int autowireStrategy)
autowireStrategy
- public int getAutowireStrategy()
protected static org.springframework.beans.factory.config.AutowireCapableBeanFactory findAutoWiringBeanFactory(org.springframework.context.ApplicationContext context)
context
- public java.lang.Object buildBean(java.lang.String beanName, java.util.Map extraContext, boolean injectInternal) throws java.lang.Exception
ObjectFactory
.
buildBean
in class com.opensymphony.xwork2.ObjectFactory
beanName
- The name of the bean to look up in the application contextextraContext
-
java.lang.Exception
public java.lang.Object buildBean(java.lang.Class clazz, java.util.Map extraContext) throws java.lang.Exception
buildBean
in class com.opensymphony.xwork2.ObjectFactory
clazz
- extraContext
-
java.lang.Exception
public java.lang.Object autoWireBean(java.lang.Object bean)
public java.lang.Object autoWireBean(java.lang.Object bean, org.springframework.beans.factory.config.AutowireCapableBeanFactory autoWiringFactory)
bean
- autoWiringFactory
- public java.lang.Class getClassInstance(java.lang.String className) throws java.lang.ClassNotFoundException
getClassInstance
in class com.opensymphony.xwork2.ObjectFactory
java.lang.ClassNotFoundException
public boolean isNoArgConstructorRequired()
isNoArgConstructorRequired
in class com.opensymphony.xwork2.ObjectFactory
public void setUseClassCache(boolean useClassCache)
useClassCache
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |