Class GenericResultWaiter

java.lang.Object
org.apache.ofbiz.service.GenericResultWaiter
All Implemented Interfaces:
Serializable, GenericRequester

public class GenericResultWaiter extends Object implements GenericRequester
Generic Result Waiter Class
See Also:
  • Field Details

    • SERVICE_RUNNING

      public static final int SERVICE_RUNNING
      Status code for a running service
      See Also:
    • SERVICE_FAILED

      public static final int SERVICE_FAILED
      Status code for a failed service
      See Also:
    • SERVICE_FINISHED

      public static final int SERVICE_FINISHED
      Status code for a successful service
      See Also:
  • Constructor Details

    • GenericResultWaiter

      public GenericResultWaiter()
  • Method Details

    • receiveResult

      public void receiveResult(Map<String,Object> result)
      Description copied from interface: GenericRequester
      Receive the result of an asynchronous service call
      Specified by:
      receiveResult in interface GenericRequester
      Parameters:
      result - Map of name, value pairs composing the result
    • receiveThrowable

      public void receiveThrowable(Throwable t)
      Description copied from interface: GenericRequester
      Receive an exception (Throwable) from an asynchronous service cell
      Specified by:
      receiveThrowable in interface GenericRequester
      Parameters:
      t - The Throwable which was received
    • status

      public int status()
      Returns the status of the service.
      Returns:
      int Status code
    • isCompleted

      public boolean isCompleted()
      If the service has completed return true
      Returns:
      boolean
    • getThrowable

      public Throwable getThrowable()
      Returns the exception which was thrown or null if none
      Returns:
      Exception
    • getResult

      public Map<String,Object> getResult()
      Gets the results of the service or null if none
      Returns:
      Map
    • waitForResult

      public Map<String,Object> waitForResult()
      Waits for the service to complete
      Returns:
      Map
    • waitForResult

      public Map<String,Object> waitForResult(long milliseconds)
      Waits for the service to complete, check the status ever n milliseconds
      Parameters:
      milliseconds -
      Returns:
      Map