Class SystemEventService.EventRequestInterceptor

    • Constructor Detail

      • EventRequestInterceptor

        public EventRequestInterceptor()
    • Method Detail

      • onStart

        public void onStart​(String requestId)
        Description copied from interface: RequestInterceptor
        Take actions before the request is handled for an operation. This will be called just before each request is sent to the correct request handler. For example: starting a transaction would happen at this point.

        If you want to interrupt the handling of this request (stop it) then throw a RequestInterceptor.RequestInterruptionException.

        Specified by:
        onStart in interface RequestInterceptor
        Parameters:
        requestId - the unique id of the request
      • onEnd

        public void onEnd​(String requestId,
                          boolean succeeded,
                          Exception failure)
        Description copied from interface: RequestInterceptor
        Take actions after the request is handled for an operation. This will be called just before each operation is totally completed. For example: closing a transaction would happen at this point.

        If you want to interrupt the handling of this request (stop it) then throw a RequestInterceptor.RequestInterruptionException.

        NOTE: it is important to realize that this will be called even if the request fails. Please check the incoming success param to see if this request was successful or not. This is your cue to rollback or commit, for example.

        Specified by:
        onEnd in interface RequestInterceptor
        Parameters:
        requestId - the unique id of the request
        succeeded - true if the request operations were successful, false if there was a failure
        failure - this is the exception associated with the failure, it is null if there is no associated exception
      • getOrder

        public int getOrder()
        Description copied from interface: OrderedService
        Sets the order to load the bean which implements this method compared to other beans of the same type. Lower orders (numbers) will be loaded first (i.e. order 1 will appear before order 3 in the list). Orders do not have to be consecutive (there can be gaps). Beans with the same order or beans with no order set will be ordered randomly.
        Specified by:
        getOrder in interface OrderedService
        Returns:
        an int which represents the loading order