example.text
Class TextInvocation

java.lang.Object
  extended by java.lang.Thread
      extended by example.text.TextInvocation
All Implemented Interfaces:
java.lang.Runnable

public class TextInvocation
extends java.lang.Thread

Handler for Invocations for the TextViewer. It runs in a separate Thread to handle Invocations.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
(package private)  javax.microedition.content.ContentHandlerServer handler
          The ContentHandler we are processing.
(package private)  javax.microedition.content.Registry registry
          The registry for access to invocations and responses.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TextInvocation(TextViewer viewer, javax.microedition.content.Invocation initialInvoc)
          Create a new TextInvocation handler with an initial Invocation, (may be null).
TextInvocation(TextViewer viewer, javax.microedition.content.Invocation initialInvoc, javax.microedition.content.Invocation previousInvoc)
           
 
Method Summary
(package private)  javax.microedition.content.Invocation currentInvocation()
          Get the current active Invocation.
(package private)  boolean done(javax.microedition.content.Invocation invocation, int status)
          Mark the current Invocation as complete with the status indicated.
(package private)  void finishedInvocation(javax.microedition.content.Invocation invocation)
          Called by the response handler when the response to a invocation arrives.
 void run()
          Run method to continually check for invocations and service them.
(package private)  void stop()
          Stop processing of Invocation requests as soon as possible.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

handler

javax.microedition.content.ContentHandlerServer handler
The ContentHandler we are processing.


registry

javax.microedition.content.Registry registry
The registry for access to invocations and responses.

Constructor Detail

TextInvocation

TextInvocation(TextViewer viewer,
               javax.microedition.content.Invocation initialInvoc,
               javax.microedition.content.Invocation previousInvoc)

TextInvocation

TextInvocation(TextViewer viewer,
               javax.microedition.content.Invocation initialInvoc)
Create a new TextInvocation handler with an initial Invocation, (may be null).

Parameters:
viewer - the TextViewer to notify of events.
initialInvoc - an initial Invocation to process
Method Detail

stop

void stop()
Stop processing of Invocation requests as soon as possible.

Overrides:
stop in class java.lang.Thread

currentInvocation

javax.microedition.content.Invocation currentInvocation()
Get the current active Invocation.

Returns:
the current Invocation

done

boolean done(javax.microedition.content.Invocation invocation,
             int status)
Mark the current Invocation as complete with the status indicated.

Parameters:
invocation - the Invocation to mark complete
status - the new status to return
Returns:
true if the application should exit

run

public void run()
Run method to continually check for invocations and service them. If the invocation is brand new; just invoke it and return. If a new invocation arrives while an Invocation is current, the current invocation is CANCELLED and the new one processed.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

finishedInvocation

void finishedInvocation(javax.microedition.content.Invocation invocation)
Called by the response handler when the response to a invocation arrives.