Search in sources :

Example 1 with ContainerBuilder

use of com.opensymphony.xwork2.inject.ContainerBuilder in project entando-core by entando.

the class ApsAdminBaseTestCase method createContainer.

protected Container createContainer() {
    ContainerBuilder builder = new ContainerBuilder();
    builder.constant("devMode", "false");
    return builder.create(true);
}
Also used : ContainerBuilder(com.opensymphony.xwork2.inject.ContainerBuilder)

Example 2 with ContainerBuilder

use of com.opensymphony.xwork2.inject.ContainerBuilder 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 ContainerBuilder (com.opensymphony.xwork2.inject.ContainerBuilder)1 Context (com.opensymphony.xwork2.inject.Context)1 SpringObjectFactory (com.opensymphony.xwork2.spring.SpringObjectFactory)1 ApplicationContext (org.springframework.context.ApplicationContext)1