creamtec.webcream
Class WebCreamManager

java.lang.Object
  extended by creamtec.webcream.WebCreamManager

public class WebCreamManager
extends java.lang.Object

WebCreamManager is a helper class containing miscellaneous methods that provide simple means of integration with WebCream system. Even though a typical application doesn't need to do anything to take advantage of WebCream, in some cases where multithreading is used to perforam background operations or differed user interface updates WebCream may render intermediate state of UI. In those cases the application programmer has 2 options. One is to remove multithreading or wait for other threads to complete in the event handling thread or main() method (e.g. using join). Second option is to explicitly mark the beginning and the end of the client operation taking control over the emulation and rendering process. First option does not require any integration with WebCream. Second option will require the programmer to make a cal to WebCreamManager.beginOperation() from the main thread (main() function during startup or event handling routine) and WebCreamManager.endOperation() when the client operation is complete and the UI state is updated. Right after endOperation() call WebCream will begin rendering of the topmost window. Even if cals to WebCreamManager methods have been made the application remains fully functional when run as a standalone Java application without WebCream. WebCreamManager will check if WebCream is currently active and if not, it will do nothing.


Method Summary
static void beginOperation()
          Marks the beginning of a complete sequence of steps letting WebCream know that rendering of HTML page should be deferred until the application calls endOperation().
static void endOperation()
          Marks the end of a complete sequence of steps prompting WebCream to begin rendering of the currently topmost window.
static int getClientId()
          Allows the running application to determine the ID of the client that is using the application.
static java.util.HashMap getRequestParameters()
          Returns name-value pairs of parameters received with the HTTP request.
static WebCreamSessionListener getWebCreamSessionListener()
          Returns client session listener
static boolean isWebCreamRunning()
          Returns true if WebCream classes are in the classpath
static void setWebCreamSessionListener(WebCreamSessionListener sessionListener)
          Sets client session listener that is called by WebCream when a client session is created or destroyed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

beginOperation

public static void beginOperation()
Marks the beginning of a complete sequence of steps letting WebCream know that rendering of HTML page should be deferred until the application calls endOperation(). If the application is ran not through WebCream, the method does nothing


endOperation

public static void endOperation()
Marks the end of a complete sequence of steps prompting WebCream to begin rendering of the currently topmost window. If the application is ran not through WebCream, the method does nothing


getClientId

public static int getClientId()
Allows the running application to determine the ID of the client that is using the application. It especially is useful for Shared execution mode when multiple users share a JVM. The IDs can be used for instance as hash values the singleton pattern. For example, if you used to have a singleton class Client with a method getInstance() that would return the shared instance, you can change the implementation of getInstance() to maintain a hashtable of all instances and use WebCreamManager.getClientId() as a hash value. If the client identity can not be established, the method returns 0. This can happen if you are using mutliple threads or if WebCream is not currently running


isWebCreamRunning

public static boolean isWebCreamRunning()
Returns true if WebCream classes are in the classpath


getRequestParameters

public static java.util.HashMap getRequestParameters()
Returns name-value pairs of parameters received with the HTTP request. Can be called only during an active request emulation


setWebCreamSessionListener

public static void setWebCreamSessionListener(WebCreamSessionListener sessionListener)
Sets client session listener that is called by WebCream when a client session is created or destroyed


getWebCreamSessionListener

public static WebCreamSessionListener getWebCreamSessionListener()
Returns client session listener



Copyright © 2000-2006 CreamTec LLC. All Rights Reserved.