Package org.apache.ofbiz.service
Class GenericResultWaiter
- java.lang.Object
-
- org.apache.ofbiz.service.GenericResultWaiter
-
- All Implemented Interfaces:
java.io.Serializable
,GenericRequester
public class GenericResultWaiter extends java.lang.Object implements GenericRequester
Generic Result Waiter Class- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
static int
SERVICE_FAILED
Status code for a failed servicestatic int
SERVICE_FINISHED
Status code for a successful servicestatic int
SERVICE_RUNNING
Status code for a running service
-
Constructor Summary
Constructors Constructor Description GenericResultWaiter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getResult()
Gets the results of the service or null if nonejava.lang.Throwable
getThrowable()
Returns the exception which was thrown or null if noneboolean
isCompleted()
If the service has completed return truevoid
receiveResult(java.util.Map<java.lang.String,java.lang.Object> result)
Receive the result of an asynchronous service callvoid
receiveThrowable(java.lang.Throwable t)
Receive an exception (Throwable) from an asynchronous service cellint
status()
Returns the status of the service.java.util.Map<java.lang.String,java.lang.Object>
waitForResult()
Waits for the service to completejava.util.Map<java.lang.String,java.lang.Object>
waitForResult(long milliseconds)
Waits for the service to complete, check the status ever n milliseconds
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
SERVICE_RUNNING
public static final int SERVICE_RUNNING
Status code for a running service- See Also:
- Constant Field Values
-
SERVICE_FAILED
public static final int SERVICE_FAILED
Status code for a failed service- See Also:
- Constant Field Values
-
SERVICE_FINISHED
public static final int SERVICE_FINISHED
Status code for a successful service- See Also:
- Constant Field Values
-
-
Method Detail
-
receiveResult
public void receiveResult(java.util.Map<java.lang.String,java.lang.Object> result)
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- See Also:
GenericRequester.receiveResult(java.util.Map)
-
receiveThrowable
public void receiveThrowable(java.lang.Throwable t)
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- See Also:
GenericRequester.receiveThrowable(java.lang.Throwable)
-
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 java.lang.Throwable getThrowable()
Returns the exception which was thrown or null if none- Returns:
- Exception
-
getResult
public java.util.Map<java.lang.String,java.lang.Object> getResult()
Gets the results of the service or null if none- Returns:
- Map
-
waitForResult
public java.util.Map<java.lang.String,java.lang.Object> waitForResult()
Waits for the service to complete- Returns:
- Map
-
waitForResult
public java.util.Map<java.lang.String,java.lang.Object> waitForResult(long milliseconds)
Waits for the service to complete, check the status ever n milliseconds- Parameters:
milliseconds
-- Returns:
- Map
-
-