public abstract class SerializedDataManager<RequestType,ReplyType>
extends java.lang.Object
SerializedDataManager.AsyncReply
handler.
If required, you can can call the fetchAndWait() method, but the user experience may be degraded, since the UI
will be blocked while the operation is happening.
The SerializedDataManager
is a generic class and you need to pass your own RequestType and ReplyType.for an example of how to implement a {@link SerializedDataManager}
Modifier and Type | Class and Description |
---|---|
static interface |
SerializedDataManager.AsyncReply<ReplyType>
Async Reply Handler for handling the remote reply
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HTTP_ONLY_COOKIES
skdviewer.properties entry for enabling httpOnly cookies
|
Constructor and Description |
---|
SerializedDataManager()
Create serialize data manager with default pool size
|
Modifier and Type | Method and Description |
---|---|
void |
cancelCurrentRequests()
Cancel any currently running tasks to make room in the pool for new submissions
|
boolean |
convertReplyToObject()
Returns true if the HTTP reply (ie the data stream) could be converted into an object.
|
void |
fetch(RequestType args,
SerializedDataManager.AsyncReply<ReplyType> replyHandler)
Fetches the data from the server.
|
ReplyType |
fetchAndWait(RequestType args)
Fetches the data from the server and waits for a reply.
|
boolean |
isBusy(RequestType args)
Returns true if the manager is currently servicing the request.
|
boolean |
isCompressed()
Return true if the reply stream is a compressed object.
|
boolean |
isPost()
Return true if the HTTP communications should POST the data.
|
public static final java.lang.String HTTP_ONLY_COOKIES
public SerializedDataManager()
public void cancelCurrentRequests()
public boolean isPost()
public boolean convertReplyToObject()
public boolean isCompressed()
public boolean isBusy(RequestType args)
args
- serice args that would have been passed to the fetch() operationpublic void fetch(RequestType args, SerializedDataManager.AsyncReply<ReplyType> replyHandler)
SerializedDataManager.AsyncReply
handler will be notified about the response.args
- URL/Service parameters to be passed to createUrl()replyHandler
- SerializedDataManager.AsyncReply
instance to handle the success or errorpublic ReplyType fetchAndWait(RequestType args) throws java.lang.Exception
args
- service/url parameters to be passed to createUrl()java.lang.Exception
- if there was an error