当前位置: 首页>>代码示例>>Java>>正文


Java AtmosphereFramework类代码示例

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


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

示例1: WebsocketConsumer

import org.atmosphere.cpr.AtmosphereFramework; //导入依赖的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: AtmosphereCoordinator

import org.atmosphere.cpr.AtmosphereFramework; //导入依赖的package包/类
AtmosphereCoordinator() {
    framework = new AtmosphereFramework();
    asynchronousProcessor = new NettyCometSupport(framework().getAtmosphereConfig());
    framework.setAsyncSupport(asynchronousProcessor);
    suspendTimer = ExecutorsFactory.getScheduler(framework.getAtmosphereConfig());
    mapper = framework.endPointMapper();
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:8,代码来源:AtmosphereCoordinator.java

示例3: initAtmosphere

import org.atmosphere.cpr.AtmosphereFramework; //导入依赖的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

示例4: framework

import org.atmosphere.cpr.AtmosphereFramework; //导入依赖的package包/类
public AtmosphereFramework framework() {
    return framework;
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:4,代码来源:AtmosphereCoordinator.java

示例5: init

import org.atmosphere.cpr.AtmosphereFramework; //导入依赖的package包/类
@Override
public void init() {
    AtmosphereFramework framework = (AtmosphereFramework) servletContext.getAttribute("AtmosphereServlet");
    servletContext.setAttribute(NOTIFICATION_SERVICE, new NotificationService(framework));
    status = ModuleStatus.ACTIVE;
}
 
开发者ID:ManyDesigns,项目名称:Portofino,代码行数:7,代码来源:AtmosphereModule.java

示例6: NotificationService

import org.atmosphere.cpr.AtmosphereFramework; //导入依赖的package包/类
public NotificationService(AtmosphereFramework framework) {
    this.framework = framework;
}
 
开发者ID:ManyDesigns,项目名称:Portofino,代码行数:4,代码来源:NotificationService.java

示例7: atmosphereFramework

import org.atmosphere.cpr.AtmosphereFramework; //导入依赖的package包/类
@Bean
public AtmosphereFramework atmosphereFramework() {
  return atmosphereServlet().framework();
}
 
开发者ID:AndreasKl,项目名称:springboot-angular-atmosphere-quickstart,代码行数:5,代码来源:WebConfigurer.java

示例8: metaBroadcaster

import org.atmosphere.cpr.AtmosphereFramework; //导入依赖的package包/类
@Bean
public MetaBroadcaster metaBroadcaster() {
  AtmosphereFramework framework = atmosphereFramework();
  return framework.metaBroadcaster();
}
 
开发者ID:AndreasKl,项目名称:springboot-angular-atmosphere-quickstart,代码行数:6,代码来源:WebConfigurer.java


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