use of org.apache.cayenne.configuration.rop.server.ROPServerModule 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(new ROPServerModule(eventBridgeParameters));
ServerRuntime runtime = ServerRuntime.builder().addConfig(configurationLocation).addModules(modules).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.rop.server.ROPServerModule 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(new ROPServerModule(eventBridgeParameters), new ProtostuffModule());
ServerRuntime runtime = ServerRuntime.builder().addConfig(configurationLocation).addModules(modules).build();
this.remoteService = runtime.getInjector().getInstance(RemoteService.class);
this.serializationService = runtime.getInjector().getInstance(ROPSerializationService.class);
WebUtil.setCayenneRuntime(servletContext, runtime);
}
Aggregations