Interface HelidonInterceptor<W>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  HelidonInterceptor.Base<W>
      HelidonInterceptor implementation providing as much logic as possible.
      static interface  HelidonInterceptor.WithPostCompletion<W>
      Common behavior among interceptors with both pre-invocation and post-completion behavior.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      Object aroundConstruct​(javax.interceptor.InvocationContext context)
      Invoked during the intercepted constructor invocation.
      default Object aroundConstruction​(javax.interceptor.InvocationContext context)
      Invokes the implementation's preInvocation logic for a constructor, once for each work item associated with the constructor.
      default Object aroundInvocation​(javax.interceptor.InvocationContext context)
      Invokes the implementation's preInvocation logic for a method, once for each work item associated with the method.
      Object aroundInvoke​(javax.interceptor.InvocationContext context)
      Invoked during the intercepted method invocation.
      void preInvocation​(javax.interceptor.InvocationContext context, W workItem)
      Performs whatever pre-invocation work is needed for the given context, applied to the specified work item.
      Iterable<W> workItems​(Executable executable)
      Returns the work items the specific interceptor instance should process.
    • Method Detail

      • aroundConstruction

        default Object aroundConstruction​(javax.interceptor.InvocationContext context)
                                   throws Exception
        Invokes the implementation's preInvocation logic for a constructor, once for each work item associated with the constructor.
        Parameters:
        context - InvocationContext
        Returns:
        any value returned by the intercepted Executable
        Throws:
        Exception - when the intercepted code throws an exception
      • aroundConstruct

        Object aroundConstruct​(javax.interceptor.InvocationContext context)
                        throws Exception
        Invoked during the intercepted constructor invocation.

        Typically, concrete implementations should extend HelidonInterceptor.Base which implements this method with @AroundConstruct. Annotation processing for @AroundConstruct does not recognize the annotation on a default method implementation defined on the interface.

        Parameters:
        context - the invocation context for the intercepted call
        Returns:
        the value returned from the intercepted constructor
        Throws:
        Exception - if the invoked constructor throws an exception
      • aroundInvocation

        default Object aroundInvocation​(javax.interceptor.InvocationContext context)
                                 throws Exception
        Invokes the implementation's preInvocation logic for a method, once for each work item associated with the method.
        Parameters:
        context - InvocationContext
        Returns:
        any value returned by the intercepted Executable
        Throws:
        Exception - when the intercepted code throws an exception
      • aroundInvoke

        Object aroundInvoke​(javax.interceptor.InvocationContext context)
                     throws Exception
        Invoked during the intercepted method invocation.

        Typically, concrete implementations should extend HelidonInterceptor.Base which implements this method with @AroundInvoke. Annotation processing for @AroundInvoke does not recognize the annotation on a default method implementation defined on the interface.

        Parameters:
        context - the invocation context for the intercepted call
        Returns:
        the value returned from the intercepted method
        Throws:
        Exception - if the invoked method throws an exception
      • workItems

        Iterable<W> workItems​(Executable executable)
        Returns the work items the specific interceptor instance should process.
        Parameters:
        executable - the specific Executable being intercepted
        Returns:
        the work items pertinent to the specified Executable
      • preInvocation

        void preInvocation​(javax.interceptor.InvocationContext context,
                           W workItem)
        Performs whatever pre-invocation work is needed for the given context, applied to the specified work item.

        If the pre-invocation handler throws an exception, any other pre-invocation

        Parameters:
        context - InvocationContext for the execution being intercepted
        workItem - the work item on which to operate