|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ocd.shell.Shell
The Shell is the main entry point to the environment. by launching the Shell through the main method the environment is initialized. The Shell environment has been written to take advantage of features provided by the netx JNLP implementation and therefore will not work with other JNLP implementations.
First the shell processes the command line arguments. The arguments on the command line should be of the form -argname argvalue. Boolean arguments can just be specified by using -argname and there value will be set to true. For example:
-arg1 value1 -arg2 -arg3 value3
Would produce the argument values of arg1=value1, arg2=true, arg3=value3. Each startup arg is placed in the shell properties with the ARGS_PROPERTY_PREFIX appended to each argument name so for the above example the shell properties would contain:
shell.arg1 = value1
shell.arg2 = true
shell.arg3 = value3
Where shell. is the ARGS_PROPERTY_PREFIX. Any shell property can be retrieved by calling Shell.getProperty()
The only required argument is the envdir argument. This argument tells the shell where all of the environment files for this application are stored.
Boot Process
When the shell is started it first executes the boot.jnlp file. The boot.jnlp file should be located in the codebase dir where the shell was started from. The boot.jnlp file can also be specified using the -boot shell argument. The boot.jnlp file could execute any JNLP application but it is recommended that it launch the ServiceStarter application which should be passed a list of services to start. If the boot.jnlp is not found in the default location then it is skipped. If it was specified using the -boot option and cannot be found then an exception will be thrown and the shell application will terminate.
Once the boot process is complete then the shell will execute the startup.jnlp file. This file works just like the boot.jnlp file and should also be located in the shell's codebase dir. The startup.jnlp file can also be specified using the -startup shell argument. The startup.jnlp file is required and if it is not located in the codebase directory or specified using the -startup argument then an exception will be thrown.
Once the startup has completed the shell will check to see if there are any visible UI Windows. If no User Interface windows can be found then the shell will terminate. This helps ensure that the shell application will at least present the user with a minimal UI. This behavior can be turned off by using the -noui shell argument.
Services
The services that are started using the Service Starter are simple java applications. More information about Services can
be found by reading the ServiceStarter
documentation.
Argument Summary
-envdir (local dir) (Required) Environment Directory for this Application -boot (url) URL of boot.jnlp file. Defaults to boot.jnlp in this Application's CodeBase -startup (url) URL of startup.jnlp file. Defaults to startup.jnlp in this Application's CodeBase -splash (url) URL of Splash Screen Image. Defaults to splash.png in this Application's CodeBase -noui Does not require that the Application create a User Interface
Field Summary | |
static java.lang.String |
ARGS_PROPERTY_PREFIX
|
static java.lang.String |
ENV_DIR_ARG
|
static java.lang.String |
NO_UI_ARG
|
Method Summary | |
void |
addShellListener(IShellListener pListener)
Add a Listener to be notified when the Shell Session has booted, started, or ended. |
void |
endSession(boolean force)
End The Shell Session |
boolean |
getBooleanProperty(java.lang.String pName,
boolean pDefault)
Get a shell property as a boolean value |
java.io.File |
getEnvdir()
Returns the envdir. |
java.lang.String |
getProperty(java.lang.String pName)
Get a shell property |
java.lang.String |
getProperty(java.lang.String pName,
java.lang.String pDefault)
Get a shell property |
static Shell |
getShell()
Get the Current Shell |
javax.swing.JPanel |
getSplashPanel()
Get the Shell's Splash Panel |
boolean |
hasBooted()
Return true if this Shell Session has been Booted |
boolean |
hasStarted()
Return true if this Shell Session has been Started |
static void |
main(java.lang.String[] args)
Main Method of the Shell Should only be called once. |
void |
removeShellListener(IShellListener pListener)
Remove a Shell Listener |
void |
setProperty(java.lang.String pName,
java.lang.String pValue)
Set a shell property |
protected void |
startServiceException(java.lang.Throwable pExp)
This is called if there is an Exception handled by the ServiceStarter when booting and Starting the Shell |
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 ARGS_PROPERTY_PREFIX
public static final java.lang.String ENV_DIR_ARG
public static final java.lang.String NO_UI_ARG
Method Detail |
public static void main(java.lang.String[] args)
args
- Arguments for Shellpublic java.io.File getEnvdir()
public boolean hasBooted()
public boolean hasStarted()
public void addShellListener(IShellListener pListener)
listener
- to addpublic void removeShellListener(IShellListener pListener)
listener
- to removepublic javax.swing.JPanel getSplashPanel()
public void endSession(boolean force)
force
- if true does not ask the user if the shell session should endpublic static Shell getShell()
public boolean getBooleanProperty(java.lang.String pName, boolean pDefault)
name
- of the propertydefault
- valuepublic java.lang.String getProperty(java.lang.String pName, java.lang.String pDefault)
name
- of the propertydefault
- valuepublic java.lang.String getProperty(java.lang.String pName)
name
- of the propertypublic void setProperty(java.lang.String pName, java.lang.String pValue)
name
- of the propertyvalue
- of Propertyprotected void startServiceException(java.lang.Throwable pExp)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |