BVB Source Codes

che Show WsAgentServletModule.java Source code

Return Download che: download WsAgentServletModule.java Source code - Download che Source code - Type:.java
  1. /*******************************************************************************
  2.  * Copyright (c) 2012-2017 Codenvy, S.A.
  3.  * All rights reserved. This program and the accompanying materials
  4.  * are made available under the terms of the Eclipse Public License v1.0
  5.  * which accompanies this distribution, and is available at
  6.  * http://www.eclipse.org/legal/epl-v10.html
  7.  *
  8.  * Contributors:
  9.  *   Codenvy, S.A. - initial API and implementation
  10.  *******************************************************************************/
  11. package org.eclipse.che.wsagent.server;
  12.  
  13. import com.google.common.collect.ImmutableMap;
  14. import com.google.inject.servlet.ServletModule;
  15.  
  16. import org.eclipse.che.api.core.cors.CheCorsFilter;
  17. import org.eclipse.che.filters.EnvironmentInitializationFilter;
  18. import org.eclipse.che.inject.DynaModule;
  19. import org.everrest.guice.servlet.GuiceEverrestServlet;
  20. import org.everrest.websockets.WSConnectionTracker;
  21.  
  22. /** @author andrew00x */
  23. @DynaModule
  24. public class WsAgentServletModule extends ServletModule {
  25.     @Override
  26.     protected void configureServlets() {
  27.         getServletContext().addListener(new WSConnectionTracker());
  28.  
  29.         filter("/*").through(CheCorsFilter.class);
  30.         filter("/api/*").through(EnvironmentInitializationFilter.class);
  31.  
  32.         serveRegex("^/api((?!(/(ws|eventbus)($|/.*)))/.*)").with(GuiceEverrestServlet.class);
  33.  
  34.         bind(io.swagger.jaxrs.config.DefaultJaxrsConfig.class).asEagerSingleton();
  35.         serve("/swaggerinit").with(io.swagger.jaxrs.config.DefaultJaxrsConfig.class, ImmutableMap
  36.                 .of("api.version", "1.0",
  37.                     "swagger.api.title", "Eclipse Che",
  38.                     "swagger.api.basepath", "/api"
  39.                    ));
  40.     }
  41. }
  42.  
downloadWsAgentServletModule.java Source code - Download che Source code
Related Source Codes/Software:
Gource - oftware version control visualization ... 2017-01-10
FDFullscreenPopGesture - A UINavigationController's category to enable full... 2017-01-10
node-style-guide - A guide for styling your node.js / JavaScript code... 2017-01-09
ImageOptim - GUI image optimizer for Mac htt... 2017-01-09
falcon - Falcon is a low-level, high-performance Python fra... 2017-01-09
notepad-plus-plus - Notepad++ official repository h... 2017-01-10
waterline - An adapter-based ORM for Node.js with support for ... 2017-01-10
Workerman - An asynchronous event driven PHP framework for eas... 2017-01-10
structor - An advanced visual editor for React components ... 2017-01-10
golearn - Machine Learning for Go 2017-01-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top