本文整理汇总了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());
}
示例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);
}
示例3: configureServlets
import org.everrest.websockets.WSConnectionTracker; //导入依赖的package包/类
@Override
protected void configureServlets() {
getServletContext().addListener(new WSConnectionTracker());
}