Annotation Type SseProducer


  • @Retention(RUNTIME)
    @Target(METHOD)
    public @interface SseProducer
    Defines a producer of SseEvents. The resource must specify a path on which to react. Optionally it may define a delay when to repeat the sending of events. The method must return a SseEvent.
    Author:
    Torsten Oltmanns
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String path
      The path for this producer to listen on.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      long delay
      The delay before the call to the producer method will be repeated.
      long maxTimes
      Specified how often the SSE producer method should be called before the connection is closed.
      java.util.concurrent.TimeUnit unit
      The TimeUnit for the delay() parameter.
    • Element Detail

      • path

        java.lang.String path
        The path for this producer to listen on.
        Returns:
        the path
      • delay

        long delay
        The delay before the call to the producer method will be repeated. The default is 1. The effective delay is calculated using the unit() parameter.
        Returns:
        the delay
        Default:
        1L
      • unit

        java.util.concurrent.TimeUnit unit
        The TimeUnit for the delay() parameter. Default is TimeUnit.SECONDS.
        Returns:
        the TimeUnit
        Default:
        java.util.concurrent.TimeUnit.SECONDS
      • maxTimes

        long maxTimes
        Specified how often the SSE producer method should be called before the connection is closed. A value of -1 means forever. Default is -1 (forever).
        Returns:
        the maximum number of times the producer method can be called before the connection is closed
        Default:
        -1L