use of org.apache.cayenne.configuration.web.WebConfiguration in project cayenne by apache.
the class ROPServlet method init.
@Override
public void init(ServletConfig configuration) throws ServletException {
checkAlreadyConfigured(configuration.getServletContext());
this.servletContext = configuration.getServletContext();
WebConfiguration configAdapter = new WebConfiguration(configuration);
String configurationLocation = configAdapter.getConfigurationLocation();
Map<String, String> eventBridgeParameters = configAdapter.getOtherParameters();
Collection<Module> modules = configAdapter.createModules();
ServerRuntime runtime = ServerRuntime.builder().addConfig(configurationLocation).addModules(modules).addModule(binder -> ROPServerModule.contributeROPBridgeProperties(binder).putAll(eventBridgeParameters)).build();
this.remoteService = runtime.getInjector().getInstance(RemoteService.class);
this.serializationService = runtime.getInjector().getInstance(ROPSerializationService.class);
WebUtil.setCayenneRuntime(servletContext, runtime);
super.init(configuration);
}
use of org.apache.cayenne.configuration.web.WebConfiguration in project cayenne by apache.
the class Http2ROPServlet method init.
@Override
public void init(ServletConfig configuration) throws ServletException {
checkAlreadyConfigured(configuration.getServletContext());
this.servletContext = configuration.getServletContext();
WebConfiguration configAdapter = new WebConfiguration(configuration);
String configurationLocation = configAdapter.getConfigurationLocation();
Map<String, String> eventBridgeParameters = configAdapter.getOtherParameters();
Collection<Module> modules = configAdapter.createModules();
ServerRuntime runtime = ServerRuntime.builder().addConfig(configurationLocation).addModule(binder -> ROPServerModule.contributeROPBridgeProperties(binder).putAll(eventBridgeParameters)).addModules(modules).build();
this.remoteService = runtime.getInjector().getInstance(RemoteService.class);
this.serializationService = runtime.getInjector().getInstance(ROPSerializationService.class);
WebUtil.setCayenneRuntime(servletContext, runtime);
}
Aggregations