|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.application.Server
org.opensubsystems.core.application.ThickClient
public class ThickClient
The main class which represents application that executes on a client computer. It provides framework for various modules to coexists together on the client computer. It's responsibility is to instantiate, coordinate and destroy these modules. Modules are specified in the configuration files using numbered properties, such as oss.thickclient.module.0=full classname for module 0 oss.thickclient.module.1=full classname for module 1 ... This class is independent of any GUI technology (such as SWT or AWT) used to actually construct the thick client. It defers all methods, which may depend of any GUI technology to the ThickClientGui interface. On the other hand this class is not an interface just because there has to be a class, which implements main method which launches the application. The application which will be started must be specified in te configuration files, using property [full classname for ThickClient class]=full classname for application to start Thick client embeds by default server since most modern enterprise applications require some kind of support for inter-application communication and therefore act both as clients and servers.
| Field Summary | |
|---|---|
static java.lang.String |
GUI_MODULE_PREFIX
This is used to name parameters such as oss.thickclient.module.0, oss.thickclient.module.1. |
protected boolean |
m_bFixedSize
If true then the window will be displayed with fixed size and cannot be resized. |
protected boolean |
m_bHideCursor
If true then hide cursor. |
protected boolean |
m_bModulesCreated
This flag is set after modules are created. |
protected boolean |
m_bStoppingGui
This flag is true when gui is being stopped. |
protected ThickClientGui |
m_gui
Gui representing the thick client application. |
protected int |
m_iScreenPosition
Position where to display GUI on the screen. |
protected java.util.Map |
m_modules
Map where key is the module name (String) and value is the module (ThickClientModule) itself. |
protected java.lang.String |
m_strActiveModuleName
Name of the module from m_modules, which is currently active. |
protected java.util.Set |
m_strPreviouslyActiveModules
Collection of module names, which were previously at least once active. |
protected static java.lang.Class |
s_clsDefaultThickClient
Default thick client class to instantiate |
protected static java.lang.String |
s_strDefaultGUITechnology
Default GUI technology to use for instantiation of thick client. |
| Fields inherited from class org.opensubsystems.core.application.Server |
|---|
m_bStarted, m_hsServer, m_iWebServerPort, s_iMaxServerStartRetry, SERVER_START_RETRYCOUNT, SERVER_START_RETRYCOUNT_DEFAULT |
| Constructor Summary | |
|---|---|
ThickClient()
Construct instance of the thick client application. |
|
ThickClient(ProductInfo product)
Construct instance of the thick client application. |
|
| Method Summary | |
|---|---|
void |
activateModule(java.lang.String strModuleName)
Activate specified module. |
protected boolean |
activateModule(ThickClientModule module,
boolean bReactivate)
Activate specified module so that it is available for user interaction. |
protected void |
addWebApplications(org.mortbay.http.HttpServer hsServer)
Install web applications which should be run on the server. |
boolean |
canStopGUI()
Check if it is OK to stop the gui. |
protected void |
createModules()
Create modules, which should be available in the thick client application. |
protected void |
destroyModules()
Destroy modules, which were created for the thick client application. |
protected void |
displayGUI()
Display the gui using previously initialized resources. |
ThickClientGui |
getGui()
Get gui for this client. |
int |
getScreenPosition()
Position where to display GUI on the screen. |
protected static ThickClient |
getThickClientInstance()
Get instance of thick client application to start. |
void |
init()
Initialize the server. |
protected void |
initScreenOptions(int iScreenPosition,
boolean bFixedSize,
boolean bHideCursor)
Initialize position and size related parameters. |
boolean |
isFixedSize()
If true then the window will be displayed with fixed size and cannot be resized. |
static void |
main(java.lang.String[] args)
The defaul implementation of the main method. |
protected void |
pasivateModule(ThickClientModule module)
Pasivate the specified module so that it is not available for user interaction anymore. |
void |
start()
Start the server. |
protected void |
startGui()
Start the GUI portion of the thick client application. |
protected void |
startThickClient()
Start the thick client. |
void |
stop()
Stop the server. |
boolean |
stopGUI()
Call this method to stop the GUI. |
protected void |
stopThickClient()
Stop the thick client. |
| Methods inherited from class org.opensubsystems.core.application.Server |
|---|
generateNewWebPort, getWebServerPort, initContext, isStarted, setWebServerPort, startServer, stopServer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String GUI_MODULE_PREFIX
protected static java.lang.String s_strDefaultGUITechnology
protected int m_iScreenPosition
protected boolean m_bFixedSize
protected boolean m_bHideCursor
protected boolean m_bStoppingGui
protected java.util.Map m_modules
protected java.lang.String m_strActiveModuleName
protected java.util.Set m_strPreviouslyActiveModules
protected boolean m_bModulesCreated
protected ThickClientGui m_gui
protected static java.lang.Class s_clsDefaultThickClient
| Constructor Detail |
|---|
public ThickClient()
public ThickClient(ProductInfo product)
product - - information about product which is running this
application, this way we will force every application to
create and publish this information in uniform way| Method Detail |
|---|
public static void main(java.lang.String[] args)
args - - arguments passed from command linepublic ThickClientGui getGui()
public boolean isFixedSize()
public int getScreenPosition()
public void init()
throws OSSException,
java.io.IOException
init in class ServerOSSException - - if there was an error starting persistance store
java.io.IOException - - if there was an error accessing database properties
public void start()
throws org.mortbay.util.MultiException,
OSSException
start in class Serverorg.mortbay.util.MultiException - - if there was an error starting the server
OSSException - - if there was an error starting the server
public void stop()
throws OSSException,
java.lang.InterruptedException
stop in class ServerOSSException - - if there was en error stopping persistance store
java.lang.InterruptedException - - if the server was stoppedpublic void activateModule(java.lang.String strModuleName)
strModuleName - - name of the module to activate.public boolean canStopGUI()
public boolean stopGUI()
protected void addWebApplications(org.mortbay.http.HttpServer hsServer)
addWebApplications in class ServerhsServer - - HTTP server to install the applications to
protected static ThickClient getThickClientInstance()
throws OSSException
OSSException - - an error has occured
protected void initScreenOptions(int iScreenPosition,
boolean bFixedSize,
boolean bHideCursor)
iScreenPosition - - position where to display GUI on the screen,
one of the GUI_XXX constantsbFixedSize - - if true then the window will be displayed with fixed
size 1024x768bHideCursor - - hide cursor (e.g. if we are on the touchscreen)
protected void startThickClient()
throws OSSException
OSSException - - an error has occured
protected void stopThickClient()
throws OSSException
OSSException - - an error has occured
protected void startGui()
throws OSSException
OSSException - - an error has occured
protected void displayGUI()
throws OSSException
OSSException - - an error has occured
protected void createModules()
throws OSSException
OSSException - - an error has occuredprotected void destroyModules()
protected void pasivateModule(ThickClientModule module)
module - - module to pasivate
protected boolean activateModule(ThickClientModule module,
boolean bReactivate)
module - - module to activatebReactivate - - this is true if the module was pasivated but it is
being immediately activated again because the other
module which caused it's pasivation coun't be
activated again. This is false if some other module
was active and now this module is being activated.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||