Search in sources :

Example 1 with ROPServerModule

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);
}
Also used : RemoteService(org.apache.cayenne.remote.RemoteService) ServerRuntime(org.apache.cayenne.configuration.server.ServerRuntime) ROPServerModule(org.apache.cayenne.configuration.rop.server.ROPServerModule) Module(org.apache.cayenne.di.Module) ROPServerModule(org.apache.cayenne.configuration.rop.server.ROPServerModule) WebConfiguration(org.apache.cayenne.configuration.web.WebConfiguration)

Example 2 with ROPServerModule

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);
}
Also used : ProtostuffModule(org.apache.cayenne.configuration.rop.client.ProtostuffModule) RemoteService(org.apache.cayenne.remote.RemoteService) ServerRuntime(org.apache.cayenne.configuration.server.ServerRuntime) ROPSerializationService(org.apache.cayenne.rop.ROPSerializationService) ROPServerModule(org.apache.cayenne.configuration.rop.server.ROPServerModule) ProtostuffModule(org.apache.cayenne.configuration.rop.client.ProtostuffModule) Module(org.apache.cayenne.di.Module) ROPServerModule(org.apache.cayenne.configuration.rop.server.ROPServerModule) WebConfiguration(org.apache.cayenne.configuration.web.WebConfiguration)

Aggregations

ROPServerModule (org.apache.cayenne.configuration.rop.server.ROPServerModule)2 ServerRuntime (org.apache.cayenne.configuration.server.ServerRuntime)2 WebConfiguration (org.apache.cayenne.configuration.web.WebConfiguration)2 Module (org.apache.cayenne.di.Module)2 RemoteService (org.apache.cayenne.remote.RemoteService)2 ProtostuffModule (org.apache.cayenne.configuration.rop.client.ProtostuffModule)1 ROPSerializationService (org.apache.cayenne.rop.ROPSerializationService)1