use of org.apache.cayenne.configuration.server.ServerRuntime 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);
}
use of org.apache.cayenne.configuration.server.ServerRuntime in project cayenne by apache.
the class ClientCaseSelfIT method testServerSetup_TearDown_Runtime.
@Test
public void testServerSetup_TearDown_Runtime() throws Exception {
ServerRuntime local = this.runtime;
assertNotNull(local);
assertSame(local, runtimeProvider.get());
tearDownLifecycleManager();
setUpLifecycleManager();
assertNotSame(local, this.runtime);
}
use of org.apache.cayenne.configuration.server.ServerRuntime in project cayenne by apache.
the class CayenneFilter method init.
public void init(FilterConfig config) throws ServletException {
checkAlreadyConfigured(config.getServletContext());
this.servletContext = config.getServletContext();
WebConfiguration configAdapter = new WebConfiguration(config);
String configurationLocation = configAdapter.getConfigurationLocation();
Collection<Module> modules = configAdapter.createModules();
modules.addAll(getAdditionalModules());
ServerRuntime runtime = ServerRuntime.builder().addConfig(configurationLocation).addModules(modules).build();
WebUtil.setCayenneRuntime(config.getServletContext(), runtime);
}
Aggregations