| java.lang.Object com.opensymphony.xwork.ObjectFactory com.opensymphony.xwork.spring.SpringObjectFactory
All known Subclasses: com.opensymphony.xwork.spring.SpringProxyableObjectFactory, com.opensymphony.webwork.spring.WebWorkSpringObjectFactory,
SpringObjectFactory | public class SpringObjectFactory extends ObjectFactory implements ApplicationContextAware(Code) | | Simple implementation of the ObjectFactory that makes use of Spring's application context if one has been configured,
before falling back on the default mechanism of instantiating a new class using the class name. In order to use
this class in your application, you will need to instantiate a copy of this class and set it as XWork's ObjectFactory
before the xwork.xml file is parsed. In a servlet environment, this could be done using a ServletContextListener.
author: Simon Stewart (sms@lateral.net) |
appContext | protected ApplicationContext appContext(Code) | | |
autoWiringFactory | protected AutowireCapableBeanFactory autoWiringFactory(Code) | | |
autowireStrategy | protected int autowireStrategy(Code) | | |
autoWireBean | public Object autoWireBean(Object bean, AutowireCapableBeanFactory autoWiringFactory)(Code) | | Parameters: bean - Parameters: autoWiringFactory - |
buildBean | public Object buildBean(String beanName, Map extraContext) throws Exception(Code) | | Looks up beans using Spring's application context before falling back to the method defined in the
ObjectFactory .
Parameters: beanName - The name of the bean to look up in the application context Parameters: extraContext - A bean from Spring or the result of calling the overriddenmethod. throws: Exception - |
findAutoWiringBeanFactory | protected AutowireCapableBeanFactory findAutoWiringBeanFactory(ApplicationContext context)(Code) | | If the given context is assignable to AutowireCapbleBeanFactory or contains a parent or a factory that is, then
set the autoWiringFactory appropriately.
Parameters: context - |
getAutowireStrategy | public int getAutowireStrategy()(Code) | | |
initObjectFactory | public void initObjectFactory()(Code) | | This method sets the ObjectFactory used by XWork to this object. It's best used as the "init-method" of a Spring
bean definition in order to hook Spring and XWork together properly (as an alternative to the
com.opensymphony.webwork.spring.lifecycle.SpringObjectFactoryListener)
|
isNoArgConstructorRequired | public boolean isNoArgConstructorRequired()(Code) | | Allows for ObjectFactory implementations that support
Actions without no-arg constructors.
false |
setApplicationContext | public void setApplicationContext(ApplicationContext appContext) throws BeansException(Code) | | Set the Spring ApplicationContext that should be used to look beans up with.
Parameters: appContext - The Spring ApplicationContext that should be used to look beans up with. |
setAutowireStrategy | public void setAutowireStrategy(int autowireStrategy)(Code) | | Sets the autowiring strategy
Parameters: autowireStrategy - |
setUseClassCache | public void setUseClassCache(boolean useClassCache)(Code) | | |
|
|