Package org.apache.ofbiz.service
Class GenericResultWaiter
java.lang.Object
org.apache.ofbiz.service.GenericResultWaiter
- All Implemented Interfaces:
Serializable
,GenericRequester
Generic Result Waiter Class
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Status code for a failed servicestatic final int
Status code for a successful servicestatic final int
Status code for a running service -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the results of the service or null if noneReturns the exception which was thrown or null if noneboolean
If the service has completed return truevoid
receiveResult
(Map<String, Object> result) Receive the result of an asynchronous service callvoid
Receive an exception (Throwable) from an asynchronous service cellint
status()
Returns the status of the service.Waits for the service to completewaitForResult
(long milliseconds) Waits for the service to complete, check the status ever n milliseconds
-
Field Details
-
SERVICE_RUNNING
public static final int SERVICE_RUNNINGStatus code for a running service- See Also:
-
SERVICE_FAILED
public static final int SERVICE_FAILEDStatus code for a failed service- See Also:
-
SERVICE_FINISHED
public static final int SERVICE_FINISHEDStatus code for a successful service- See Also:
-
-
Constructor Details
-
GenericResultWaiter
public GenericResultWaiter()
-
-
Method Details
-
receiveResult
Description copied from interface:GenericRequester
Receive the result of an asynchronous service call- Specified by:
receiveResult
in interfaceGenericRequester
- Parameters:
result
- Map of name, value pairs composing the result
-
receiveThrowable
Description copied from interface:GenericRequester
Receive an exception (Throwable) from an asynchronous service cell- Specified by:
receiveThrowable
in interfaceGenericRequester
- 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
Returns the exception which was thrown or null if none- Returns:
- Exception
-
getResult
Gets the results of the service or null if none- Returns:
- Map
-
waitForResult
Waits for the service to complete- Returns:
- Map
-
waitForResult
Waits for the service to complete, check the status ever n milliseconds- Parameters:
milliseconds
-- Returns:
- Map
-