|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread wjhk.jupload2.context.JavascriptHandler
public class JavascriptHandler
Separate thread spawned by the (signed) applet at initialization time so it will run in a context with the same privileges. Does nothing but wait to be notified of the presence of a command to be executed in the jsCommand String variable.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static java.lang.String |
COMMAND_START_UPLOAD
Command code, for upload. |
private java.lang.String |
jsCommand
The current command, or null if the thread is not currently running command. |
private JUploadPanel |
jUploadPanel
Reference to the main panel of the applet. |
static java.lang.String |
RETURN_BUSY
One return code for doCommand: indicates that the thread is busy, and can execute this command. |
static java.lang.String |
RETURN_STARTED
One return code for doCommand: indicates that the thread is busy, and can execute this command. |
private UploadPolicy |
uploadPolicy
Reference to the current upload policy. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
JavascriptHandler(UploadPolicy uploadPolicy,
JUploadPanel theJUploadPanel)
Constructor for JavascriptHandler |
Method Summary | |
---|---|
void |
clearCommand()
Synchronized method allows for safely clearing jsCommand string |
java.lang.String |
doCommand(java.lang.String command)
Method for passing a command (String) to be executed (asynchronously) by the run() method of this object's thread. |
void |
doWait()
Synchronized method to enable call to wait() |
java.lang.String |
getCommand()
Synchronized method allows for safely accessing jsCommand string |
void |
run()
Method to run when thread is started. |
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, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COMMAND_START_UPLOAD
public static final java.lang.String RETURN_BUSY
public static final java.lang.String RETURN_STARTED
private UploadPolicy uploadPolicy
private JUploadPanel jUploadPanel
private java.lang.String jsCommand
Constructor Detail |
---|
public JavascriptHandler(UploadPolicy uploadPolicy, JUploadPanel theJUploadPanel)
uploadPolicy
- The current upload policy. Used for debug output.theJUploadPanel
- Whose methods will will be invoked in order to
execute the received commandsMethod Detail |
---|
public java.lang.String doCommand(java.lang.String command)
command
-
public java.lang.String getCommand()
public void clearCommand()
public void doWait() throws java.lang.InterruptedException
java.lang.InterruptedException
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |