• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ApplicationConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.atmosphere.cpr.ApplicationConfig的典型用法代码示例。如果您正苦于以下问题:Java ApplicationConfig类的具体用法?Java ApplicationConfig怎么用?Java ApplicationConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ApplicationConfig类属于org.atmosphere.cpr包,在下文中一共展示了ApplicationConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: WebsocketConsumer

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
public WebsocketConsumer(WebsocketEndpoint endpoint, Processor processor) {
    super(endpoint, processor);
    this.framework = new AtmosphereFramework(false, true);

    framework.setUseNativeImplementation(false);
    framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true");
    framework.addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL, 
        endpoint.isUseStreaming() ? WebsocketStreamHandler.class.getName() : WebsocketHandler.class.getName());
    //REVISIT we need to disable JSR356 detection for now when using jetty-9.3 when using atmosphere-2.4.x
    framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPRESS_JSR356, "true");
    framework.init();
    
    WebSocketProtocol wsp = framework.getWebSocketProtocol();
    if (wsp instanceof WebsocketHandler) {
        ((WebsocketHandler)wsp).setConsumer(this);            
    } else {
        throw new IllegalArgumentException("Unexpected WebSocketHandler: " + wsp);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:WebsocketConsumer.java


示例2: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
  Injector injector = Guice.createInjector(new GuiceModule());
  Server server = injector.getInstance(Server.class);

  HttpTransportServer httpTransportServer = new HttpTransportServer().ontransport(server);
  WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().ontransport(server);

  // Installs the server on Atmosphere platform
  ServletContext context = event.getServletContext();
  Servlet servlet = new AsityAtmosphereServlet().onhttp(httpTransportServer).onwebsocket
    (wsTransportServer);
  ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName(),
    servlet);
  reg.setAsyncSupported(true);
  reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
  reg.addMapping("/cettia");
  // Start scheduler
  injector.getInstance(Clock.class).init();
}
 
开发者ID:cettia,项目名称:cettia-examples,代码行数:21,代码来源:Bootstrap.java


示例3: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
  ObjectGraph objectGraph = ObjectGraph.create(new DaggerModule());
  objectGraph.inject(this);

  HttpTransportServer httpTransportServer = new HttpTransportServer().ontransport(server);
  WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().ontransport(server);

  // Installs the server on Atmosphere platform
  ServletContext context = event.getServletContext();
  Servlet servlet = new AsityAtmosphereServlet().onhttp(httpTransportServer).onwebsocket
    (wsTransportServer);
  ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName(),
    servlet);
  reg.setAsyncSupported(true);
  reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
  reg.addMapping("/cettia");
  // Start scheduler
  clock.init();
}
 
开发者ID:cettia,项目名称:cettia-examples,代码行数:21,代码来源:Bootstrap.java


示例4: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
  ServiceLocator locator = ServiceLocatorUtilities.createAndPopulateServiceLocator();
  ServiceLocatorUtilities.enableImmediateScope(locator);
  Server server = locator.getService(Server.class);

  HttpTransportServer httpTransportServer = new HttpTransportServer().ontransport(server);
  WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().ontransport(server);

  // Installs the server on Atmosphere platform
  ServletContext context = event.getServletContext();
  Servlet servlet = new AsityAtmosphereServlet().onhttp(httpTransportServer).onwebsocket
    (wsTransportServer);
  ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName(),
    servlet);
  reg.setAsyncSupported(true);
  reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
  reg.addMapping("/cettia");
}
 
开发者ID:cettia,项目名称:cettia-examples,代码行数:20,代码来源:Bootstrap.java


示例5: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
  RegistryBuilder builder = new RegistryBuilder();
  builder.add(TapestryModule.class);
  Registry registry = builder.build();
  registry.performRegistryStartup();
  final Server server = registry.getService(Server.class);

  HttpTransportServer httpTransportServer = new HttpTransportServer().ontransport(server);
  WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().ontransport(server);

  // Installs the server on Atmosphere platform
  ServletContext context = event.getServletContext();
  Servlet servlet = new AsityAtmosphereServlet().onhttp(httpTransportServer).onwebsocket
    (wsTransportServer);
  ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName(),
    servlet);
  reg.setAsyncSupported(true);
  reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
  reg.addMapping("/cettia");
}
 
开发者ID:cettia,项目名称:cettia-examples,代码行数:22,代码来源:Bootstrap.java


示例6: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
@SuppressWarnings({"resource"})
public void contextInitialized(ServletContextEvent event) {
  AnnotationConfigApplicationContext applicationContext = new
    AnnotationConfigApplicationContext(SpringConfig.class);
  Server server = applicationContext.getBean(Server.class);

  HttpTransportServer httpTransportServer = new HttpTransportServer().ontransport(server);
  WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().ontransport(server);

  // Installs the server on Atmosphere platform
  ServletContext context = event.getServletContext();
  Servlet servlet = new AsityAtmosphereServlet().onhttp(httpTransportServer).onwebsocket
    (wsTransportServer);
  ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName(),
    servlet);
  reg.setAsyncSupported(true);
  reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
  reg.addMapping("/cettia");
}
 
开发者ID:cettia,项目名称:cettia-examples,代码行数:21,代码来源:Bootstrap.java


示例7: startServer

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
protected void startServer() throws Exception {
    server = new Server();
    ServerConnector connector = new ServerConnector(server);
    connector.setPort(port);
    server.addConnector(connector);
    ServletContextHandler handler = new ServletContextHandler();
    handler.addEventListener(new ServletContextListener() {
        @Override
        public void contextInitialized(ServletContextEvent event) {
            ServletContext context = event.getServletContext();
            Servlet servlet = new VibeAtmosphereServlet().onhttp(performer.serverAction());
            ServletRegistration.Dynamic reg = context.addServlet(VibeAtmosphereServlet.class.getName(), servlet);
            reg.setAsyncSupported(true);
            reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
            reg.addMapping("/test");
        }

        @Override
        public void contextDestroyed(ServletContextEvent sce) {}
    });
    server.setHandler(handler);
    server.start();
}
 
开发者ID:vibe-project,项目名称:vibe-java-platform,代码行数:25,代码来源:AtmosphereServerHttpExchangeTest.java


示例8: startServer

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
protected void startServer() throws Exception {
    server = new Server();
    ServerConnector connector = new ServerConnector(server);
    connector.setPort(port);
    server.addConnector(connector);
    ServletContextHandler handler = new ServletContextHandler();
    handler.addEventListener(new ServletContextListener() {
        @Override
        public void contextInitialized(ServletContextEvent event) {
            ServletContext context = event.getServletContext();
            Servlet servlet = new VibeAtmosphereServlet().onwebsocket(performer.serverAction());
            ServletRegistration.Dynamic reg = context.addServlet(VibeAtmosphereServlet.class.getName(), servlet);
            reg.setAsyncSupported(true);
            reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
            reg.addMapping("/test");
        }

        @Override
        public void contextDestroyed(ServletContextEvent sce) {}
    });
    server.setHandler(handler);
    server.start();
}
 
开发者ID:vibe-project,项目名称:vibe-java-platform,代码行数:25,代码来源:AtmosphereServerWebSocketTest.java


示例9: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
    Injector injector = Guice.createInjector(new GuiceModule());
    Server server = injector.getInstance(Server.class);

    HttpTransportServer httpTransportServer = new HttpTransportServer().transportAction(server);
    WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().transportAction(server);

    // Installs the server on Atmosphere platform
    ServletContext context = event.getServletContext();
    Servlet servlet = new VibeAtmosphereServlet().httpAction(httpTransportServer).wsAction(wsTransportServer);
    ServletRegistration.Dynamic reg = context.addServlet(VibeAtmosphereServlet.class.getName(), servlet);
    reg.setAsyncSupported(true);
    reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
    reg.addMapping("/vibe");
    // Start scheduler
    injector.getInstance(Clock.class).init();
}
 
开发者ID:vibe-project,项目名称:vibe-examples,代码行数:19,代码来源:Bootstrap.java


示例10: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
    ObjectGraph objectGraph = ObjectGraph.create(new DaggerModule());
    objectGraph.inject(this);

    HttpTransportServer httpTransportServer = new HttpTransportServer().transportAction(server);
    WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().transportAction(server);

    // Installs the server on Atmosphere platform
    ServletContext context = event.getServletContext();
    Servlet servlet = new VibeAtmosphereServlet().httpAction(httpTransportServer).wsAction(wsTransportServer);
    ServletRegistration.Dynamic reg = context.addServlet(VibeAtmosphereServlet.class.getName(), servlet);
    reg.setAsyncSupported(true);
    reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
    reg.addMapping("/vibe");
    // Start scheduler
    clock.init();
}
 
开发者ID:vibe-project,项目名称:vibe-examples,代码行数:19,代码来源:Bootstrap.java


示例11: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
    ServiceLocator locator = ServiceLocatorUtilities.createAndPopulateServiceLocator();
    ServiceLocatorUtilities.enableImmediateScope(locator);
    Server server = locator.getService(Server.class);
    
    HttpTransportServer httpTransportServer = new HttpTransportServer().transportAction(server);
    WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().transportAction(server);

    // Installs the server on Atmosphere platform
    ServletContext context = event.getServletContext();
    Servlet servlet = new VibeAtmosphereServlet().httpAction(httpTransportServer).wsAction(wsTransportServer);
    ServletRegistration.Dynamic reg = context.addServlet(VibeAtmosphereServlet.class.getName(), servlet);
    reg.setAsyncSupported(true);
    reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
    reg.addMapping("/vibe");
}
 
开发者ID:vibe-project,项目名称:vibe-examples,代码行数:18,代码来源:Bootstrap.java


示例12: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
    RegistryBuilder builder = new RegistryBuilder();
    builder.add(TapestryModule.class);
    Registry registry = builder.build();
    registry.performRegistryStartup();        
    final Server server = registry.getService(Server.class);
    
    HttpTransportServer httpTransportServer = new HttpTransportServer().transportAction(server);
    WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().transportAction(server);
    
    // Installs the server on Atmosphere platform
    ServletContext context = event.getServletContext();
    Servlet servlet = new VibeAtmosphereServlet().httpAction(httpTransportServer).wsAction(wsTransportServer);
    ServletRegistration.Dynamic reg = context.addServlet(VibeAtmosphereServlet.class.getName(), servlet);
    reg.setAsyncSupported(true);
    reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
    reg.addMapping("/vibe");
}
 
开发者ID:vibe-project,项目名称:vibe-examples,代码行数:20,代码来源:Bootstrap.java


示例13: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
@SuppressWarnings({ "resource" })
public void contextInitialized(ServletContextEvent event) {
    AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfig.class);
    Server server = applicationContext.getBean(Server.class);
    
    HttpTransportServer httpTransportServer = new HttpTransportServer().transportAction(server);
    WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().transportAction(server);

    // Installs the server on Atmosphere platform
    ServletContext context = event.getServletContext();
    Servlet servlet = new VibeAtmosphereServlet().httpAction(httpTransportServer).wsAction(wsTransportServer);
    ServletRegistration.Dynamic reg = context.addServlet(VibeAtmosphereServlet.class.getName(), servlet);
    reg.setAsyncSupported(true);
    reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
    reg.addMapping("/vibe");
}
 
开发者ID:vibe-project,项目名称:vibe-examples,代码行数:18,代码来源:Bootstrap.java


示例14: query

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@POST
public void query(String permission) {
    if (api != null) {
        AtmosphereResource r = (AtmosphereResource) request.getAttribute(ApplicationConfig.ATMOSPHERE_RESOURCE);
        if (r != null) {
            Subject sub = (Subject) r.getRequest().getAttribute(FrameworkConfig.SECURITY_SUBJECT);
            User u = api.getAuth().getUser(sub.getPrincipal().toString());
            Boolean permOK = u.isPermitted(permission);
            PermissionCheckRepresentation p = new PermissionCheckRepresentation(u.getName(), permission, permOK);
            try {
                r.getResponse().write(om.writeValueAsString(p));
            } catch (JsonProcessingException ex) {
            }
        } else {
            throw new IllegalStateException();
        }
    }
}
 
开发者ID:freedomotic,项目名称:freedomotic,代码行数:19,代码来源:AtmospherePermissionCheckResource.java


示例15: initAtmosphere

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
private AtmosphereCoordinator initAtmosphere(Router router, VertxVaadinService service) {
    final String bufferSize = String.valueOf(PushConstants.WEBSOCKET_BUFFER_SIZE);

    AtmosphereInterceptor trackMessageSize = new TrackMessageSizeInterceptor();

    VertxAtmosphere.Builder pushBuilder = new VertxAtmosphere.Builder()
        .initParam(ApplicationConfig.BROADCASTER_CACHE, UUIDBroadcasterCache.class.getName())
        .initParam(ApplicationConfig.ANNOTATION_PROCESSOR, VoidAnnotationProcessor.class.getName())
        .initParam(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true")
        .initParam(ApplicationConfig.MESSAGE_DELIMITER, String.valueOf(PushConstants.MESSAGE_DELIMITER))
        .initParam(ApplicationConfig.DROP_ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, "false")
        // Disable heartbeat (it does not emit correct events client side)
        // https://github.com/Atmosphere/atmosphere-javascript/issues/141
        .initParam(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTORS, HeartbeatInterceptor.class.getName())
        .initParam(ApplicationConfig.WEBSOCKET_BUFFER_SIZE, bufferSize)
        .initParam(ApplicationConfig.WEBSOCKET_MAXTEXTSIZE, bufferSize)
        .initParam(ApplicationConfig.WEBSOCKET_MAXBINARYSIZE, bufferSize)
        .initParam(ApplicationConfig.PROPERTY_ALLOW_SESSION_TIMEOUT_REMOVAL, "false")
        // Disable Atmosphere's message about commercial support
        .initParam("org.atmosphere.cpr.showSupportMessage", "false")
        .interceptor(trackMessageSize);

    AtmosphereCoordinator atmosphereCoordinator = ExposeAtmosphere.newCoordinator(pushBuilder);
    AtmosphereFramework framework = atmosphereCoordinator.framework();
    trackMessageSize.configure(framework.getAtmosphereConfig());

    VertxPushHandler vertxPushHandler = new VertxPushHandler(service);
    vertxPushHandler.setLongPollingSuspendTimeout(framework.getAtmosphereConfig()
        .getInitParameter(com.vaadin.server.Constants.SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING, -1));

    PushAtmosphereHandler pushAtmosphereHandler = new PushAtmosphereHandler();
    pushAtmosphereHandler.setPushHandler(vertxPushHandler);
    framework.addAtmosphereHandler("/*", pushAtmosphereHandler);

    atmosphereCoordinator.ready();

    service.addServiceDestroyListener(event -> atmosphereCoordinator.shutdown());

    return atmosphereCoordinator;
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:41,代码来源:VertxVaadin.java


示例16: startServer

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
protected void startServer(int port, final Action<ServerHttpExchange> requestAction) throws
  Exception {
  server = new Server();
  ServerConnector connector = new ServerConnector(server);
  connector.setPort(port);
  server.addConnector(connector);
  ServletContextHandler handler = new ServletContextHandler();
  handler.addEventListener(new ServletContextListener() {
    @Override
    public void contextInitialized(ServletContextEvent event) {
      ServletContext context = event.getServletContext();
      Servlet servlet = new AsityAtmosphereServlet().onhttp(requestAction);
      ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName
        (), servlet);
      reg.setAsyncSupported(true);
      reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE
        .toString());
      reg.setInitParameter(ApplicationConfig.SCAN_CLASSPATH, Boolean.FALSE.toString());
      reg.addMapping(TEST_URI);
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
    }
  });
  server.setHandler(handler);
  server.start();
}
 
开发者ID:cettia,项目名称:asity,代码行数:30,代码来源:AtmosphereServerHttpExchangeTest.java


示例17: startServer

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
protected void startServer(int port, final Action<ServerWebSocket> websocketAction) throws
  Exception {
  server = new Server();
  ServerConnector connector = new ServerConnector(server);
  connector.setPort(port);
  server.addConnector(connector);
  ServletContextHandler handler = new ServletContextHandler();
  handler.addEventListener(new ServletContextListener() {
    @Override
    public void contextInitialized(ServletContextEvent event) {
      ServletContext context = event.getServletContext();
      Servlet servlet = new AsityAtmosphereServlet().onwebsocket(websocketAction);
      ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName
        (), servlet);
      reg.setAsyncSupported(true);
      reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE
        .toString());
      reg.setInitParameter(ApplicationConfig.SCAN_CLASSPATH, Boolean.FALSE.toString());
      reg.addMapping(TEST_URI);
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
    }
  });
  server.setHandler(handler);
  server.start();
}
 
开发者ID:cettia,项目名称:asity,代码行数:30,代码来源:AtmosphereServerWebSocketTest.java


示例18: addInitParameters

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
protected void addInitParameters(final ServletRegistrationBean servletRegistrationBean) {
    super.addInitParameters(servletRegistrationBean);

    servletRegistrationBean.addInitParameter(ApplicationConfig.JSR356_MAPPING_PATH, "/UI");
    servletRegistrationBean.addInitParameter(ApplicationConfig.ATMOSPHERE_INTERCEPTORS,
            SpringSecurityAtmosphereInterceptor.class.getName());

}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:10,代码来源:AsyncVaadinServletConfiguration.java


示例19: contextInitialized

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent event) {
  HttpTransportServer httpTransportServer = new HttpTransportServer().ontransport(server);
  WebSocketTransportServer wsTransportServer = new WebSocketTransportServer().ontransport(server);

  // Installs the server on Atmosphere platform
  ServletContext context = event.getServletContext();
  Servlet servlet = new AsityAtmosphereServlet().onhttp(httpTransportServer).onwebsocket
    (wsTransportServer);
  ServletRegistration.Dynamic reg = context.addServlet(AsityAtmosphereServlet.class.getName(),
    servlet);
  reg.setAsyncSupported(true);
  reg.setInitParameter(ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTOR, Boolean.TRUE.toString());
  reg.addMapping("/cettia");
}
 
开发者ID:cettia,项目名称:cettia-examples,代码行数:16,代码来源:Bootstrap.java


示例20: registerAtmosphere

import org.atmosphere.cpr.ApplicationConfig; //导入依赖的package包/类
private void registerAtmosphere(Environment environment, Clock clock) {
    AtmosphereServlet servlet = new AtmosphereServlet();
    servlet.framework().addInitParameter(ApplicationConfig.ANNOTATION_PACKAGE, WebSocketHandler.class.getPackage().getName());
    servlet.framework().addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true");

    ServletRegistration.Dynamic registration = environment.servlets().addServlet("atmosphere", servlet);
    registration.addMapping(WEBSOCKET_SERVLET_MAPPING);

    BroadcasterFactory broadcasterFactory = servlet.framework().getBroadcasterFactory();
    clock.setNextRoundCallback(round -> WebSocketHandler.broadcastRound(broadcasterFactory, round));
}
 
开发者ID:phxql,项目名称:restwars,代码行数:12,代码来源:RestwarsApplication.java



注:本文中的org.atmosphere.cpr.ApplicationConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobCounter类代码示例发布时间:2022-05-21
下一篇:
Java D3DWindowSurfaceData类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap