Class AtmosphereAnnotations

java.lang.Object
org.atmosphere.cpr.AtmosphereAnnotations

public final class AtmosphereAnnotations extends Object
Single source of truth for all Atmosphere annotation types and their processor mappings.

All modules that need the list of core Atmosphere annotations should reference this class rather than maintaining their own copy. The one exception is AnnotationScanningServletContainerInitializer whose @HandlesTypes annotation requires compile-time class literals and cannot delegate to a runtime list.

  • Method Details

    • coreAnnotations

      public static List<Class<? extends Annotation>> coreAnnotations()
      Returns the unmodifiable list of all core Atmosphere annotation types.
      Returns:
      the core annotations
    • servicePath

      public static String servicePath(Class<?> annotatedClass)
      Returns the path declared by the service annotation carried by annotatedClass, or null when it carries none.

      ManagedService and RoomService both declare a path() that may hold a {template} segment, and both are registered through the same AnnotatedProxy wrapper and the same interceptor chain. Path resolution therefore has to treat them identically: testing for @ManagedService alone silently skips a @RoomService, and every @PathParam field on it injects null.

      Parameters:
      annotatedClass - the user class behind an AnnotatedProxy
      Returns:
      the declared path, or null if the class carries no path-bearing service annotation
    • coreAnnotationNames

      public static List<String> coreAnnotationNames()
      Returns the fully-qualified class names of all core Atmosphere annotations. Useful for modules that work with string-based annotation names (e.g. Jandex DotName).
      Returns:
      the core annotation names