Class JakartaServerEndpointMapper

java.lang.Object
io.micronaut.servlet.annotation.processor.JakartaServerEndpointMapper
All Implemented Interfaces:
io.micronaut.core.naming.Named, io.micronaut.inject.annotation.AnnotationMapper<Annotation>, io.micronaut.inject.annotation.NamedAnnotationMapper

public final class JakartaServerEndpointMapper extends Object
Maps jakarta.websocket.server.ServerEndpoint to io.micronaut.websocket.annotation.ServerWebSocket.

The URI template syntax is the same in both models, so the path is copied as is. The subprotocols array becomes the comma separated list Micronaut expects.

The scope is not decided here: a mapper sees only the annotation, and a scope the class declares itself has to win. JakartaWebSocketVisitor makes the endpoint a prototype when the class declares no scope, which is the Jakarta contract of one endpoint instance per connection.

Since:
6.2.0
Author:
graemerocher
  • Constructor Details

    • JakartaServerEndpointMapper

      public JakartaServerEndpointMapper()
      Default constructor.
  • Method Details

    • getName

      public final String getName()
      Specified by:
      getName in interface io.micronaut.core.naming.Named
    • map

      public final List<io.micronaut.core.annotation.AnnotationValue<?>> map(io.micronaut.core.annotation.AnnotationValue<Annotation> annotation, io.micronaut.inject.visitor.VisitorContext visitorContext)
      Specified by:
      map in interface io.micronaut.inject.annotation.AnnotationMapper<Annotation>