use of com.opensymphony.xwork2.inject.Inject in project onebusaway-application-modules by camsys.
the class ResourceUrlFunction method setServletContext.
@Inject(required = true)
public void setServletContext(ServletContext servletContext) {
WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
context.getAutowireCapableBeanFactory().autowireBean(this);
}
use of com.opensymphony.xwork2.inject.Inject in project onebusaway-application-modules by camsys.
the class MultiActionProxyFactory method setActionMappers.
@Inject(MAPPINGS)
public void setActionMappers(String list) {
if (list != null) {
String[] tokens = list.split(",");
for (String token : tokens) {
String[] kvp = token.split("=");
String key = kvp[0];
String name = kvp[1];
ActionProxyFactory factory = container.getInstance(ActionProxyFactory.class, name);
if (factory != null) {
_prefixedActionProxyFactories.add(new Prefixed<ActionProxyFactory>(key, factory));
} else {
throw new IllegalStateException("unknown ActionProxyFactory " + name);
}
}
}
}
use of com.opensymphony.xwork2.inject.Inject in project onebusaway-application-modules by camsys.
the class ConfigurationValueFunction method setServletContext.
@Inject(required = true)
public void setServletContext(ServletContext servletContext) {
WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
context.getAutowireCapableBeanFactory().autowireBean(this);
}
use of com.opensymphony.xwork2.inject.Inject 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;
}
});
}
use of com.opensymphony.xwork2.inject.Inject in project onebusaway-application-modules by camsys.
the class MultiActionMapper method setActionMappers.
@Inject(MAPPINGS)
public void setActionMappers(String list) {
if (list != null) {
String[] tokens = list.split(",");
for (String token : tokens) {
String[] kvp = token.split("=");
String key = kvp[0];
String name = kvp[1];
ActionMapper mapper = container.getInstance(ActionMapper.class, name);
if (mapper != null) {
_prefixedActionMappers.add(new Prefixed<ActionMapper>(key, mapper));
} else {
throw new IllegalStateException("unknown ActionMapper " + name);
}
}
}
}
Aggregations