|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.creamtec.ajaxswing.core.ClientAgent
public abstract class ClientAgent
Main class within the client process/virtual process. The agent is responsible for loading the client starting class, executing it's main function, and responding to request to process Http requests. It also emulates user actions for the running client process and acts as a main point of contact and coordination of the client application. Client Agent can execute in within a shared JVM or as a stand alone process, in which case it makes itself available through RMI.
Each user, that connects to the AjaxSwing enabled application, receives his own instance of the client agent.
| Nested Class Summary | |
|---|---|
static class |
ClientAgent.InitLock
Synchronizes the initialization of the JVM |
static class |
ClientAgent.OperationLock
Synchronizes the processing of a user-defined operation. |
static class |
ClientAgent.RequestLock
Synchronizes the processing of a request. |
| Field Summary | |
|---|---|
static boolean |
shuttingDown
|
| Constructor Summary | |
|---|---|
ClientAgent(java.lang.String agentName,
java.lang.String appName)
Initializes the client agent |
|
| Method Summary | |
|---|---|
void |
addBlockedThread(AjaxSwingThread thread)
Adds the given thread to the list of blocked threads within the clinet. |
void |
addFastSubmitHandler(FastSubmitHandler handler,
java.lang.String paramKey)
|
void |
addURLParamHandler(URLParameterHandler handler,
java.lang.String paramKey)
|
void |
allowDownload(java.lang.String downloadFileName)
|
boolean |
allowExit()
Checks if System.exit() is allowed to shutdown the JVM |
void |
beginOperation()
Begins a custom operation |
void |
checkAndMonitorAsynchronousUpdates()
Checks if the number of threads at the moment called is different then the number of threads last marked. |
void |
clearAllowedDownloads()
|
void |
doRun()
Does the job of running the client application |
void |
endOperation()
Marks an end of custom operation |
void |
endOperation(boolean endsOnModalDialog)
Marks that next modal dialog ends custom operation |
void |
exit()
Safe shutdown of JVM. |
AjaxSwingThreadGroup |
getAjaxSwingThreadGroup()
Returns the thread group that owns all threads of this agent |
java.lang.String |
getAppName()
Returns application name |
int |
getBrowserID()
Returns the browser ID of the user, that the client agent is associated with |
java.lang.String |
getBrowserLocale()
|
float |
getBrowserVersion()
Returns the browser version of the user, that the client agent is associated with |
java.lang.ClassLoader |
getClassLoader()
Returns the class loader used to load the classes of this virtual client |
int |
getClientId()
Returns agent name |
java.awt.datatransfer.Clipboard |
getClipboard()
|
java.lang.String |
getComponentProperty(java.lang.Object component,
java.lang.String property)
Looks up and returns the value of the component property in the current window |
ComponentUpdateManager |
getComponentUpdateManager()
Returns component update manager purposed to store component states and generate state updates |
static ClientAgent |
getCurrentInstance()
Returns the instance of ClientAgent, associated with the calling thread May not work correctly in a multi threaded application |
boolean |
getEndOperationOnModalDialog()
|
AjaxSwingEventQueue |
getEventQueue()
Used to retrieve the virtual user specific AWT event queue |
java.lang.Throwable |
getException()
Returns the exception cought while processing a request |
java.lang.String |
getExitPage()
|
AbstractDocument |
getHTMLPage()
Returns HTML Page, associated with this client |
AgentInitData |
getInitData()
Returns application initialization data |
java.awt.Dimension |
getMaximumWindowSize(java.awt.Window window)
|
java.lang.Object |
getOperationLock()
Used to control multithreaded applications |
AbstractDocumentRenderer |
getPageRenderer()
Returns the instance of PageRenderer, associated with this client |
AjaxSwingProperties |
getProps()
Returns the application initialization properties |
AjaxSwingRepaintManager |
getRepaintManager()
|
HttpRequestData |
getRequestData()
Returns data received from the browser |
AgentRequestFilter |
getRequestFilter()
Returns request filter instance or null |
long |
getRequestId()
Each request increments the id |
HttpResponseData |
getResponseData()
Returns data received from the browser |
java.lang.String |
getScriptToAppend()
|
java.util.HashMap |
getSession()
Returns the session map associated with the client. |
long |
getSessionTimeout()
|
java.util.List |
getTempFiles()
Client agent stores the temporary files created for the user They are automatically deleted when the agent is shutdown |
java.util.TimeZone |
getTimeZone()
returns timezone for client browser, based on available information from browser. |
int |
getTimeZoneCurrentOffset()
returns the time difference between GMT and current local time, in minutes |
int |
getTimeZoneRawOffset()
returns the time difference between GMT and local time, in minutes, not affected by daylight saving time |
boolean |
getTimeZoneUseDaylight()
returns if timezone use daylight saving time |
AjaxSwingUIManager |
getUIManager()
Returns the instance of UIManager, associated with this client |
int |
getUpdateBrowserInterval()
|
java.util.Locale |
getUserLocale()
|
java.lang.String |
getWindowProperty(java.lang.String windowTitle,
java.lang.String key)
Looks up and returns the value of the property if set for a window with the given title |
int |
getWindowProperty(java.lang.String windowTitle,
java.lang.String key,
int defaultValue)
|
java.util.List |
getWindowsForRendering()
|
WindowUpdater |
getWindowUpdater()
Returns the instance of WindowUpdater, associated with this client |
void |
init(AgentInitData data,
HttpRequestData requestData)
Completes client initialization by storing the data. |
void |
initProperties(java.lang.String appName)
Initializes generic properties and variables of the client agent that do not depend on the specific application configuration |
static void |
installExitTrap()
Installs the security manager to intercept System.exit() attempts. |
void |
installToolkit()
Installs AWT toolkit. |
boolean |
isApplet()
Can be used to test if the application is running as an applet |
boolean |
isBrowserIE()
Returns true if user agent is Netscape or compatible |
boolean |
isBrowserNS()
Returns true if user agent is Netscape or compatible |
boolean |
isDownloadAllowed(java.lang.String downloadFileName)
Returns true if the download of the given file name is allowed |
boolean |
isOperationActive()
Operations can be defined using the application properties file to fine tune a multithreaded application |
boolean |
isRequestActive()
Can be used to test if the agent is currently processing a request |
boolean |
isRunning()
Returns true if the client is already executing |
static boolean |
isToolkitInstalled()
Returns true if the toolkit has already been installed |
void |
monitorAsynchronousUpdates()
Starts monitoring of UI updates by enabling browser update interval |
void |
monitorAsynchronousUpdates(int duration,
int interval)
|
void |
openInNewTab(java.lang.String url)
|
void |
print(byte[] pdfFile)
|
void |
removeBlockedThread(AjaxSwingThread thread)
Removes the given thread from a list of blocked threads. |
void |
removeFastSubmitHandler(FastSubmitHandler handler,
java.lang.String paramKey)
|
void |
removeURLParamHandler(URLParameterHandler handler,
java.lang.String paramKey)
|
void |
runApp(boolean wait)
Runs the application/applet. |
void |
setAllowExit(boolean allow)
Used to allow or disallow JVM shutdown |
void |
setBrowserLocale(java.lang.String browserLocale)
|
void |
setClientSize(int width,
int height)
|
void |
setException(java.lang.Throwable x)
Sets the exception that occured in while processing a request |
void |
setExitPage(java.lang.String pageName)
|
void |
setHTMLPage(AbstractDocument page)
|
void |
setRequestData(HttpRequestData data)
|
void |
setResponseData(HttpResponseData httpResponseData)
Sets the data structure for HTTP response |
void |
setScriptToAppend(java.lang.String script)
|
void |
setSessionTimeout(long seconds)
|
void |
setUpdateBrowser(boolean updateBrowser)
If set to true, when next updateInterval call comes, the browser will be refreshed to synchronize it with the Swing state on the server |
void |
setUpdateBrowserInterval(int newUpdateInterval)
Sets the value of router.updateInterval property |
void |
setUserLocale(java.util.Locale currentLocale)
|
boolean |
shouldUpdateBrowser()
|
void |
shutdown()
Initiates shutdown sequence and returns immediately |
void |
waitForBlockedThreads(java.lang.Object[] blockedThreads)
Waits until all blocked threads finish running |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.creamtec.ajaxswing.core.ClientAgentRemote |
|---|
ping, processHttpRequest, renderWindows |
| Field Detail |
|---|
public static boolean shuttingDown
| Constructor Detail |
|---|
public ClientAgent(java.lang.String agentName,
java.lang.String appName)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public void init(AgentInitData data,
HttpRequestData requestData)
throws java.rmi.RemoteException,
java.lang.Exception
init in interface ClientAgentRemotejava.rmi.RemoteException
java.lang.Exception
public void setClientSize(int width,
int height)
public void initProperties(java.lang.String appName)
throws java.rmi.RemoteException,
java.lang.Exception
java.rmi.RemoteException
java.lang.Exceptionpublic void shutdown()
shutdown in interface ClientAgentRemotepublic boolean allowExit()
public void exit()
public void setAllowExit(boolean allow)
allow - true to allow JVM shutdownpublic AjaxSwingEventQueue getEventQueue()
public int getBrowserID()
public boolean isBrowserNS()
public boolean isBrowserIE()
public float getBrowserVersion()
public java.util.List getWindowsForRendering()
throws java.lang.Exception
java.lang.Exception
public void runApp(boolean wait)
throws AjaxSwingException,
java.rmi.RemoteException
runApp in interface ClientAgentRemoteAjaxSwingException
java.rmi.RemoteExceptionpublic AjaxSwingRepaintManager getRepaintManager()
public void doRun()
public AbstractDocument getHTMLPage()
public void setHTMLPage(AbstractDocument page)
throws java.lang.Exception
java.lang.Exceptionpublic boolean isRunning()
public AjaxSwingUIManager getUIManager()
public static ClientAgent getCurrentInstance()
public void addBlockedThread(AjaxSwingThread thread)
public void removeBlockedThread(AjaxSwingThread thread)
public void waitForBlockedThreads(java.lang.Object[] blockedThreads)
throws java.lang.Throwable
blockedThreads -
java.lang.Throwablepublic boolean isRequestActive()
public boolean isOperationActive()
public boolean isApplet()
public java.lang.Object getOperationLock()
public void beginOperation()
java.lang.Exceptionpublic void endOperation()
java.lang.Exceptionpublic void endOperation(boolean endsOnModalDialog)
java.lang.Exceptionpublic boolean getEndOperationOnModalDialog()
public AbstractDocumentRenderer getPageRenderer()
public WindowUpdater getWindowUpdater()
public ComponentUpdateManager getComponentUpdateManager()
public AjaxSwingProperties getProps()
getProps in interface ClientAgentRemotepublic AgentInitData getInitData()
public java.util.List getTempFiles()
getTempFiles in interface ClientAgentRemotepublic long getRequestId()
public static boolean isToolkitInstalled()
public void installToolkit()
public static void installExitTrap()
public java.lang.Throwable getException()
public HttpRequestData getRequestData()
public void setRequestData(HttpRequestData data)
public HttpResponseData getResponseData()
public void setResponseData(HttpResponseData httpResponseData)
httpResponseData - HttpResponseDatapublic AgentRequestFilter getRequestFilter()
public AjaxSwingThreadGroup getAjaxSwingThreadGroup()
public void setException(java.lang.Throwable x)
x - exception to be reported to the userpublic java.util.HashMap getSession()
public java.lang.String getAppName()
public int getClientId()
public java.awt.Dimension getMaximumWindowSize(java.awt.Window window)
public java.lang.String getWindowProperty(java.lang.String windowTitle,
java.lang.String key)
windowTitle - window title text, which does not have to be an exact match and can be a substringkey - property name to search for, for example "refresh"
public int getWindowProperty(java.lang.String windowTitle,
java.lang.String key,
int defaultValue)
public java.lang.String getComponentProperty(java.lang.Object component,
java.lang.String property)
componentKey - property name to search for, for example "refresh"
public java.lang.ClassLoader getClassLoader()
public java.awt.datatransfer.Clipboard getClipboard()
public boolean shouldUpdateBrowser()
public void setUpdateBrowser(boolean updateBrowser)
updateBrowser - public int getUpdateBrowserInterval()
public void setUpdateBrowserInterval(int newUpdateInterval)
newUpdateInterval -
public boolean isDownloadAllowed(java.lang.String downloadFileName)
throws java.rmi.RemoteException
isDownloadAllowed in interface ClientAgentRemotejava.rmi.RemoteExceptionpublic void allowDownload(java.lang.String downloadFileName)
public void clearAllowedDownloads()
public void openInNewTab(java.lang.String url)
public void print(byte[] pdfFile)
public java.lang.String getScriptToAppend()
public void setScriptToAppend(java.lang.String script)
public void setSessionTimeout(long seconds)
setSessionTimeout in interface ClientAgentRemotepublic long getSessionTimeout()
getSessionTimeout in interface ClientAgentRemote
public void addURLParamHandler(URLParameterHandler handler,
java.lang.String paramKey)
public void removeURLParamHandler(URLParameterHandler handler,
java.lang.String paramKey)
public void addFastSubmitHandler(FastSubmitHandler handler,
java.lang.String paramKey)
public void removeFastSubmitHandler(FastSubmitHandler handler,
java.lang.String paramKey)
public void monitorAsynchronousUpdates()
component -
public void monitorAsynchronousUpdates(int duration,
int interval)
public void checkAndMonitorAsynchronousUpdates()
public int getTimeZoneCurrentOffset()
public int getTimeZoneRawOffset()
public boolean getTimeZoneUseDaylight()
public java.util.TimeZone getTimeZone()
public java.lang.String getExitPage()
getExitPage in interface ClientAgentRemotepublic void setExitPage(java.lang.String pageName)
setExitPage in interface ClientAgentRemotepublic java.util.Locale getUserLocale()
getUserLocale in interface ClientAgentRemotepublic void setUserLocale(java.util.Locale currentLocale)
setUserLocale in interface ClientAgentRemotepublic java.lang.String getBrowserLocale()
getBrowserLocale in interface ClientAgentRemotepublic void setBrowserLocale(java.lang.String browserLocale)
setBrowserLocale in interface ClientAgentRemote
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||