Search in sources :

Example 1 with AnnotationWebSocketHandlerBuilder

use of cn.taketoday.web.socket.annotation.AnnotationWebSocketHandlerBuilder in project today-framework by TAKETODAY.

the class WebSocketConfig method annotationWebSocketHandlerBuilder.

@MissingBean(value = AnnotationWebSocketHandlerBuilder.class)
AnnotationWebSocketHandlerBuilder annotationWebSocketHandlerBuilder(List<EndpointParameterResolver> resolvers) {
    final AnnotationWebSocketHandlerBuilder handlerBuilder;
    if (ClassUtils.isPresent("jakarta.websocket.Session")) {
        handlerBuilder = new StandardAnnotationWebSocketHandlerBuilder();
    } else {
        handlerBuilder = new AnnotationWebSocketHandlerBuilder();
    }
    handlerBuilder.registerDefaultResolvers();
    handlerBuilder.addResolvers(resolvers);
    // @since 4.0 trimToSize
    handlerBuilder.trimToSize();
    return handlerBuilder;
}
Also used : StandardAnnotationWebSocketHandlerBuilder(cn.taketoday.web.socket.annotation.StandardAnnotationWebSocketHandlerBuilder) StandardAnnotationWebSocketHandlerBuilder(cn.taketoday.web.socket.annotation.StandardAnnotationWebSocketHandlerBuilder) AnnotationWebSocketHandlerBuilder(cn.taketoday.web.socket.annotation.AnnotationWebSocketHandlerBuilder) MissingBean(cn.taketoday.context.annotation.MissingBean)

Example 2 with AnnotationWebSocketHandlerBuilder

use of cn.taketoday.web.socket.annotation.AnnotationWebSocketHandlerBuilder in project today-framework by TAKETODAY.

the class WebSocketConfig method annotationWebSocketHandlerBuilder.

@MissingBean(value = AnnotationWebSocketHandlerBuilder.class)
AnnotationWebSocketHandlerBuilder annotationWebSocketHandlerBuilder(List<EndpointParameterResolver> resolvers, List<WebSocketConfiguration> configurers) {
    AnnotationWebSocketHandlerBuilder handlerBuilder;
    if (ClassUtils.isPresent("jakarta.websocket.Session")) {
        handlerBuilder = new StandardAnnotationWebSocketHandlerBuilder();
    } else {
        handlerBuilder = new AnnotationWebSocketHandlerBuilder();
    }
    // configure EndpointParameterResolver
    for (WebSocketConfiguration configurer : configurers) {
        configurer.configureEndpointParameterResolvers(resolvers);
    }
    handlerBuilder.registerDefaultResolvers();
    handlerBuilder.addResolvers(resolvers);
    // @since 4.0 trimToSize
    handlerBuilder.trimToSize();
    return handlerBuilder;
}
Also used : StandardAnnotationWebSocketHandlerBuilder(cn.taketoday.web.socket.annotation.StandardAnnotationWebSocketHandlerBuilder) StandardAnnotationWebSocketHandlerBuilder(cn.taketoday.web.socket.annotation.StandardAnnotationWebSocketHandlerBuilder) AnnotationWebSocketHandlerBuilder(cn.taketoday.web.socket.annotation.AnnotationWebSocketHandlerBuilder) MissingBean(cn.taketoday.context.annotation.MissingBean)

Example 3 with AnnotationWebSocketHandlerBuilder

use of cn.taketoday.web.socket.annotation.AnnotationWebSocketHandlerBuilder in project today-infrastructure by TAKETODAY.

the class WebSocketConfig method annotationWebSocketHandlerBuilder.

@MissingBean(value = AnnotationWebSocketHandlerBuilder.class)
AnnotationWebSocketHandlerBuilder annotationWebSocketHandlerBuilder(List<EndpointParameterResolver> resolvers, List<WebSocketConfiguration> configurers) {
    AnnotationWebSocketHandlerBuilder handlerBuilder;
    if (ClassUtils.isPresent("jakarta.websocket.Session")) {
        handlerBuilder = new StandardAnnotationWebSocketHandlerBuilder();
    } else {
        handlerBuilder = new AnnotationWebSocketHandlerBuilder();
    }
    // configure EndpointParameterResolver
    for (WebSocketConfiguration configurer : configurers) {
        configurer.configureEndpointParameterResolvers(resolvers);
    }
    handlerBuilder.registerDefaultResolvers();
    handlerBuilder.addResolvers(resolvers);
    // @since 4.0 trimToSize
    handlerBuilder.trimToSize();
    return handlerBuilder;
}
Also used : StandardAnnotationWebSocketHandlerBuilder(cn.taketoday.web.socket.annotation.StandardAnnotationWebSocketHandlerBuilder) StandardAnnotationWebSocketHandlerBuilder(cn.taketoday.web.socket.annotation.StandardAnnotationWebSocketHandlerBuilder) AnnotationWebSocketHandlerBuilder(cn.taketoday.web.socket.annotation.AnnotationWebSocketHandlerBuilder) MissingBean(cn.taketoday.context.annotation.MissingBean)

Aggregations

MissingBean (cn.taketoday.context.annotation.MissingBean)3 AnnotationWebSocketHandlerBuilder (cn.taketoday.web.socket.annotation.AnnotationWebSocketHandlerBuilder)3 StandardAnnotationWebSocketHandlerBuilder (cn.taketoday.web.socket.annotation.StandardAnnotationWebSocketHandlerBuilder)3