Class InterceptorResponse

java.lang.Object
org.distributeme.core.interceptor.InterceptorResponse

public class InterceptorResponse extends Object
Returned by the interceptor as a result of call interception.
Version:
$Id: $Id
Author:
lrosenberg
  • Field Details

    • CONTINUE

      public static final InterceptorResponse CONTINUE
      Default reply variable. Helps save heap space ;-).
    • RETURN_AND_FAIL

      public static final InterceptorResponse RETURN_AND_FAIL
      Default reply variable. Helps save heap space ;-).
    • ABORT_AND_FAIL

      public static final InterceptorResponse ABORT_AND_FAIL
      Default reply variable. Helps save heap space ;-).
  • Constructor Details

  • Method Details

    • getCommand

      Getter for the field command.

      Returns:
      a InterceptorResponse.InterceptorCommand object.
    • toString

      public String toString()

      toString.

      Overrides:
      toString in class Object
      Returns:
      a String object.
    • getException

      public Exception getException()

      Getter for the field exception.

      Returns:
      a Exception object.
    • getReturnValue

      public Object getReturnValue()

      Getter for the field returnValue.

      Returns:
      a Object object.
    • returnNow

      public static final InterceptorResponse returnNow(Object returnValue)
      Factory method to create a ready to use response. This response signalizes that the execution should be immediately stopped and a return value returned to the caller.
      Parameters:
      returnValue - return value which should be returned to the caller.
      Returns:
      the ready-to-use InterceptorResponse object.
    • returnLater

      public static final InterceptorResponse returnLater(Object returnValue)
      Factory method to create a ready to use response. This response signalizes that the execution should be continued and a return value returned to the caller later. This is useful if you want to give other interceptors a chance to interact with the new return value (logging, debug etc).
      Parameters:
      returnValue - return value which should be returned to the caller.
      Returns:
      the ready-to-use InterceptorResponse object.
    • abortNow

      public static final InterceptorResponse abortNow(Exception anException)
      Factory method to create a ready to use response. Aborts immediately and throws the exception.
      Parameters:
      anException - exception to be thrown on the client side.
      Returns:
      the ready-to-use InterceptorResponse object.