Search in sources :

Example 1 with SpringObjectFactory

use of com.opensymphony.xwork2.spring.SpringObjectFactory in project onebusaway-application-modules by camsys.

the class SpringContainer method register.

@Override
public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException {
    // Since we're about to override...
    builder.setAllowDuplicates(true);
    builder.factory(ObjectFactory.class, new Factory<ObjectFactory>() {

        public ObjectFactory create(Context xworkContext) throws Exception {
            SpringObjectFactory f = new SpringObjectFactory();
            xworkContext.getContainer().inject(f);
            f.setApplicationContext(_applicationContext);
            f.setAutowireStrategy(_autoWireStrategy);
            return f;
        }
    });
}
Also used : Context(com.opensymphony.xwork2.inject.Context) ApplicationContext(org.springframework.context.ApplicationContext) SpringObjectFactory(com.opensymphony.xwork2.spring.SpringObjectFactory) SpringObjectFactory(com.opensymphony.xwork2.spring.SpringObjectFactory) ObjectFactory(com.opensymphony.xwork2.ObjectFactory) ConfigurationException(com.opensymphony.xwork2.config.ConfigurationException)

Aggregations

ObjectFactory (com.opensymphony.xwork2.ObjectFactory)1 ConfigurationException (com.opensymphony.xwork2.config.ConfigurationException)1 Context (com.opensymphony.xwork2.inject.Context)1 SpringObjectFactory (com.opensymphony.xwork2.spring.SpringObjectFactory)1 ApplicationContext (org.springframework.context.ApplicationContext)1