|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.creamtec.ajaxswing.core.AjaxSwingThread
public class AjaxSwingThread
AjaxSwing uses a pool of its own threads to process incoming requests. Some of the operations, such as displaying a modal dialog, can block the current thread until the user closes the dialog. While this is expected behavior for GUI applications, it is undesirable for HTTP request processing. To solve the blocking issue, AjaxSwing emulates the requests on AjaxSwingThread and if a modal dialog is displayed, the thread notifies the client agent that it is blocked. The client agent then renders the top level window and returns to the router.
Nested Class Summary | |
---|---|
static class |
AjaxSwingThread.ThreadFlag
Lock flag that is used to synchronize the execution of operations on this thread |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static int |
EMULATE_REQUEST
|
static int |
VOID_METHOD_VOID
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
AjaxSwingThread(AjaxSwingThreadGroup group)
|
Method Summary | |
---|---|
void |
emulateRequest(AbstractDocument page,
HttpRequestData data)
Runs request emulation on this thread |
AjaxSwingThreadGroup |
getAjaxSwingThreadGroup()
Returns AjaxSwingThreadGroup that own this thread |
ClientAgent |
getClientAgent()
Returns the client agent that owns this thread |
java.lang.Object |
getFlag()
Returns thread flag. |
boolean |
isBlocked()
Returns true if this thread is currently blocked |
boolean |
isRunning()
Returns true if this thread is currently executing an operation |
void |
raiseFlag()
Notifies the caller (the client agent) that the thread has finished the processing of an operation |
void |
resetData()
Release all references so objects can be garbage collected |
void |
run()
Runs a loop waiting for an operation to process. |
void |
runMethod(ClientAgent clientAgent,
java.lang.Object object,
java.lang.String methodName)
Runs the object's method with a given name on this thread. |
void |
setBlocked(boolean blocked)
Called by GUI subsystem to notify this thread that it is about to become blocked. |
void |
shutdown()
Stops this thread |
java.lang.String |
toString()
|
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, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int VOID_METHOD_VOID
public static final int EMULATE_REQUEST
Constructor Detail |
---|
public AjaxSwingThread(AjaxSwingThreadGroup group)
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void runMethod(ClientAgent clientAgent, java.lang.Object object, java.lang.String methodName) throws java.lang.Exception
clientAgent
- ClientAgentobject
- ObjectmethodName
- name of the method to run. The method should have no parameters and should return no values
java.lang.Exception
public void emulateRequest(AbstractDocument page, HttpRequestData data) throws java.lang.Exception
page
- HTMLPagedata
- HttpRequestData
java.lang.Exception
public void setBlocked(boolean blocked)
blocked
- booleanpublic boolean isBlocked()
public boolean isRunning()
public java.lang.Object getFlag()
public void raiseFlag()
public ClientAgent getClientAgent()
public void resetData()
public java.lang.String toString()
toString
in class java.lang.Thread
public AjaxSwingThreadGroup getAjaxSwingThreadGroup()
public void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |