當前位置: 首頁>>代碼示例>>Java>>正文


Java WSConnectionTracker類代碼示例

本文整理匯總了Java中org.everrest.websockets.WSConnectionTracker的典型用法代碼示例。如果您正苦於以下問題:Java WSConnectionTracker類的具體用法?Java WSConnectionTracker怎麽用?Java WSConnectionTracker使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WSConnectionTracker類屬於org.everrest.websockets包,在下文中一共展示了WSConnectionTracker類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureServlets

import org.everrest.websockets.WSConnectionTracker; //導入依賴的package包/類
@Override
protected void configureServlets() {
  filter(pathForLoginFilter).through(com.codenvy.auth.sso.client.LoginFilter.class);

  // comma separated list of paths like "/service1,/service2"
  bindConstant().annotatedWith(Names.named("csrf_filter.paths_accepting_parameters")).to("/ssh");
  filter(pathForLoginFilter).through(CodenvyCsrfFilter.class);

  final Map<String, String> corsFilterParams = new HashMap<>();
  corsFilterParams.put("cors.allowed.origins", DEFAULT_ALLOWED_ORIGINS);
  corsFilterParams.put(
      "cors.allowed.methods", "GET," + "POST," + "HEAD," + "OPTIONS," + "PUT," + "DELETE");
  corsFilterParams.put(
      "cors.allowed.headers",
      "Content-Type,"
          + "X-Requested-With,"
          + "accept,"
          + "Origin,"
          + "Access-Control-Request-Method,"
          + "Access-Control-Request-Headers");
  corsFilterParams.put("cors.support.credentials", "true");
  // preflight cache is available for 10 minutes
  corsFilterParams.put("cors.preflight.maxage", "10");
  bind(CorsFilter.class).in(Singleton.class);
  filter("/*").through(CorsFilter.class, corsFilterParams);

  bind(com.codahale.metrics.servlets.ThreadDumpServlet.class).in(Singleton.class);
  bind(com.codahale.metrics.servlets.PingServlet.class).in(Singleton.class);
  serve("/metrics/ping").with(com.codahale.metrics.servlets.PingServlet.class);
  serve("/metrics/threaddump").with(com.codahale.metrics.servlets.ThreadDumpServlet.class);

  serve("/oauth").with(com.codenvy.auth.sso.oauth.OAuthLoginServlet.class);
  filter("/oauth").through(com.codenvy.auth.sso.oauth.OauthLoginFilter.class);
  install(new com.codenvy.auth.sso.client.deploy.SsoClientServletModule());
  serveRegex("^((?!(\\/(ws|eventbus|websocket)($|\\/.*)))\\/.*)")
      .with(org.everrest.guice.servlet.GuiceEverrestServlet.class);

  getServletContext().addListener(new WSConnectionTracker());
  install(new com.codenvy.auth.sso.client.deploy.SsoClientServletModule());
  install(new BasicSwaggerConfigurationModule());
}
 
開發者ID:codenvy,項目名稱:codenvy,代碼行數:42,代碼來源:OnPremisesIdeApiServletModule.java

示例2: configureServlets

import org.everrest.websockets.WSConnectionTracker; //導入依賴的package包/類
@Override
protected void configureServlets() {
    getServletContext().addListener(new WSConnectionTracker());

    bind(AdaptiveEnvironmentFilter.class)
            .toProvider(SpringIntegration.fromSpring(AdaptiveEnvironmentFilter.class, "adaptiveEnvironmentFilter"))
            .in(Singleton.class);

    Filter corsFilter = getCORSFilter();


    filter("/*").through(corsFilter); //TODO remove this filter in PRODUCTION
    filter("/*").through(AdaptiveEnvironmentFilter.class);
    serve("/api/ws/*").with(CodenvyEverrestWebSocketServlet.class);
    serve("/api/*").with(GuiceEverrestServlet.class);


}
 
開發者ID:AdaptiveMe,項目名稱:adaptive-services-dashbar,代碼行數:19,代碼來源:ApiServletModule.java

示例3: configureServlets

import org.everrest.websockets.WSConnectionTracker; //導入依賴的package包/類
@Override
protected void configureServlets() {
  getServletContext().addListener(new WSConnectionTracker());
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:5,代碼來源:WsAgentServletModule.java


注:本文中的org.everrest.websockets.WSConnectionTracker類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。