| java.lang.Object com.sun.midp.content.InvocationStore
InvocationStore | class InvocationStore (Code) | | The store for pending Invocations.
New Invocations are queued with
InvocationStore.put method and
retrieved with the
InvocationStore.get method. The
InvocationStore.cancel method is used to unblock calls to blocking
InvocationStore.get methods.
Synchronization is performed by the native methods; access
is serialized by the VM running in a single native thread and
by NOT preempting native method calls.
The native code uses the SNI ability to block a thread and
unblock it at a later time. The implementation does not poll for
requests but blocks, if requested, until it is unblocked.
|
Method Summary | |
static void | cancel() Cancel a blocked
InvocationStore.get or
InvocationStore.listen method if it is blocked in the native code. | static InvocationImpl | getByTid(int tid, int relative) Get an Invocation from the store based on its tid . | static InvocationImpl | getCleanup(int suiteId, String classname) Performs cleanup for a ContentHandler
by suiteId and classname.
Any marked
InvocationStore.setCleanup invocations still in the queue
are handled based on status:
- ACTIVE Invocations are returned from this method
so they can be have the ERROR status set and so the
invoking application relaunched.
- INIT Invocations are requeued to the invoking application
with ERROR status.
| static InvocationImpl | getRequest(int suiteId, String classname, boolean shouldBlock) Get a new InvocationImpl request from the store using a MIDlet
suiteId and classname. | static InvocationImpl | getResponse(InvocationImpl invoc, int suiteId, String classname, boolean shouldBlock) Get a new InvocationImpl response from the store using a
MIDlet suiteId and classname. | static boolean | listen(int suiteId, String classname, boolean request, boolean shouldBlock) Listen for a matching invocation. | static void | put(InvocationImpl invoc) Put a new Invocation into the store. | static void | setCleanup(int suiteId, String classname, boolean cleanup) Marks any existing invocations for the content handler. | static void | setListenNotify(int suiteId, String classname, boolean request) Reset the flags for requests or responses that are pending. | static void | setParams(InvocationImpl invoc) Updates the parameters of the invocation in the native store. | static void | setStatus(InvocationImpl invoc) Sets the status of an existing Invocation. | static int | size() Return the number of invocations in the native queue. |
getByTid | static InvocationImpl getByTid(int tid, int relative)(Code) | | Get an Invocation from the store based on its tid .
The normal state transitions and dispositions are NOT performed.
If TID == 0 then the first tid is used as the reference.
If TID == 0 and relative == 0 then null is returned.
This method never waits.
Parameters: tid - the tid to fetch Parameters: relative - -1, 0, +1 to get previous, equal, or next an InvocationImpl object if a matching tid was found;otherwise null |
getCleanup | static InvocationImpl getCleanup(int suiteId, String classname)(Code) | | Performs cleanup for a ContentHandler
by suiteId and classname.
Any marked
InvocationStore.setCleanup invocations still in the queue
are handled based on status:
- ACTIVE Invocations are returned from this method
so they can be have the ERROR status set and so the
invoking application relaunched.
- INIT Invocations are requeued to the invoking application
with ERROR status.
- OK, CANCELLED, ERROR, or INITIATED Invocations are
discrded.
- HOLD status Invocations are retained pending
completion of previous Invocation. TBD: Chained HOLDs...
Parameters: suiteId - the MIDletSuite ID Parameters: classname - the classname InvocationImpl if any was found withthe same MIDlet suiteId and classname;null is returned if there is no matching Invocation |
getRequest | static InvocationImpl getRequest(int suiteId, String classname, boolean shouldBlock)(Code) | | Get a new InvocationImpl request from the store using a MIDlet
suiteId and classname.
Parameters: suiteId - the MIDlet suiteId to search for,MUST not be null Parameters: classname - to match, must not be null Parameters: shouldBlock - true if the method should blockwaiting for an Invocation InvocationImpl if any was found withthe same MIDlet suiteId and classname withits status is set to ACTIVE;null is returned if there is no matching Invocation |
getResponse | static InvocationImpl getResponse(InvocationImpl invoc, int suiteId, String classname, boolean shouldBlock)(Code) | | Get a new InvocationImpl response from the store using a
MIDlet suiteId and classname.
The response is removed from the store.
Parameters: invoc - an InvocationImpl to fill with the response Parameters: suiteId - the MIDletSuite ID Parameters: classname - the classname Parameters: shouldBlock - true if the method should blockwaiting for an Invocation InvocationImpl if any was found withthe same MIDlet suiteId and classname if one was requested;null is returned if there is no matching Invocation |
listen | static boolean listen(int suiteId, String classname, boolean request, boolean shouldBlock)(Code) | | Listen for a matching invocation.
When a matching invocation is present, true is returned.
Each Invocation instance is only returned once.
After it has been returned once; it is ignored subsequently.
Parameters: suiteId - the MIDlet suiteId to search for,MUST not be null Parameters: classname - to match, must not be null Parameters: request - true to listen for a request; else a response Parameters: shouldBlock - true if the method should blockwaiting for an Invocation true if a matching invocation is present; false otherwise |
setCleanup | static void setCleanup(int suiteId, String classname, boolean cleanup)(Code) | | Marks any existing invocations for the content handler.
Any marked invocation will be modified by
InvocationStore.getCleanup .
Parameters: suiteId - the suite to mark Parameters: classname - the MIDlet within the suite Parameters: cleanup - true to mark the Invocation forcleanup at exit |
setListenNotify | static void setListenNotify(int suiteId, String classname, boolean request)(Code) | | Reset the flags for requests or responses that are pending.
Once reset, any pending requests or responses will be
returned when listen0 is called.
Parameters: suiteId - the MIDlet suiteId to search for,MUST not be null Parameters: classname - to match, must not be null Parameters: request - true to reset request notification flags;else reset response notification flags |
setParams | static void setParams(InvocationImpl invoc)(Code) | | Updates the parameters of the invocation in the native store.
The ID, URL, type, action, arguments, and data are
stored again in native.
Parameters: invoc - an InvocationImpl previously retrieved with get |
setStatus | static void setStatus(InvocationImpl invoc)(Code) | | Sets the status of an existing Invocation.
If the status is OK, CANCELLED, ERROR, or INITIATED
and a response is required then the invocation is
requeued to the invoking application; if no response
is required the request is discarded and the transaction id (tid)
is set to zero.
Parameters: invoc - an InvocationImpl previously retrieved with get |
size | static int size()(Code) | | Return the number of invocations in the native queue.
the number of invocations in the native queue |
|
|