use of org.everrest.core.impl.EverrestConfiguration in project che by eclipse.
the class ServerContainerInitializeListener method getEverrestProcessor.
protected EverrestProcessor getEverrestProcessor(ServletContext servletContext) {
final DependencySupplier dependencies = (DependencySupplier) servletContext.getAttribute(DependencySupplier.class.getName());
final ResourceBinder resources = (ResourceBinder) servletContext.getAttribute(ResourceBinder.class.getName());
final ProviderBinder providers = (ProviderBinder) servletContext.getAttribute(ApplicationProviderBinder.class.getName());
final EverrestConfiguration copyOfEverrestConfiguration = new EverrestConfiguration(getEverrestConfiguration(servletContext));
copyOfEverrestConfiguration.setProperty(EverrestConfiguration.METHOD_INVOKER_DECORATOR_FACTORY, WebSocketMethodInvokerDecoratorFactory.class.getName());
final RequestHandlerImpl requestHandler = new RequestHandlerImpl(new RequestDispatcher(resources), providers);
return new EverrestProcessor(copyOfEverrestConfiguration, dependencies, requestHandler, null);
}
use of org.everrest.core.impl.EverrestConfiguration in project che by eclipse.
the class ServerContainerInitializeListener method contextInitialized.
@Override
public final void contextInitialized(ServletContextEvent sce) {
final ServletContext servletContext = sce.getServletContext();
websocketContext = MoreObjects.firstNonNull(servletContext.getInitParameter("org.everrest.websocket.context"), "");
websocketEndPoint = MoreObjects.firstNonNull(servletContext.getInitParameter("org.eclipse.che.websocket.endpoint"), "");
eventBusEndPoint = MoreObjects.firstNonNull(servletContext.getInitParameter("org.eclipse.che.eventbus.endpoint"), "");
webApplicationDeclaredRoles = new WebApplicationDeclaredRoles(servletContext);
everrestConfiguration = (EverrestConfiguration) servletContext.getAttribute(EVERREST_CONFIG_ATTRIBUTE);
if (everrestConfiguration == null) {
everrestConfiguration = new EverrestConfiguration();
}
final ServerContainer serverContainer = (ServerContainer) servletContext.getAttribute("javax.websocket.server.ServerContainer");
try {
wsServerEndpointConfig = createWsServerEndpointConfig(servletContext);
eventbusServerEndpointConfig = createEventbusServerEndpointConfig(servletContext);
serverContainer.addEndpoint(wsServerEndpointConfig);
serverContainer.addEndpoint(eventbusServerEndpointConfig);
} catch (DeploymentException e) {
throw new IllegalStateException(e.getMessage(), e);
}
}
Aggregations