use of org.everrest.core.tools.WebApplicationDeclaredRoles 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