com.partnersoft.v3x.util
Class AppEnvironment

java.lang.Object
  extended by com.partnersoft.v3x.util.AppEnvironment

public class AppEnvironment
extends java.lang.Object

Environment for an application; essentially a global object used to define high-level app behavior.


Constructor Summary
AppEnvironment()
           
 
Method Summary
 void addExitCommand(java.lang.Runnable command)
          Add an exit command.
 void disableSystemExit()
           
 void enableSystemExit()
           
 void exitApp()
          Exit the application.
 void exitAppWithError()
          Exit the application.
 java.lang.String getBuildNumber()
          Returns the build number (a six-digit date plus alphabetic sequence).
 java.lang.String getCopyrightNotice()
          Returns a Partner copyright notice.
 java.lang.Runnable getExitMethod()
           
 java.lang.String getJREDescription()
          Returns a description of the current JRE.
 boolean getLastAppExitedWithError()
           
 java.lang.String getOSDescription()
          Returns a description of the current operating system.
 java.lang.String getPhoneNumber()
          Returns the Partner phone number.
 boolean getUseHomeDir()
           
 java.lang.String getWebsite()
          Returns a Partner web URL.
 boolean isGUI()
           
 boolean isGUILog()
           
 boolean isLinux()
           
 boolean isReadOnly()
          If true, app is running in a read-only environment (CDROM or demo mode).
 PropMap processCommandLine(java.lang.String syntaxPath, java.lang.String[] args)
          Get command-line arguments as a PropMap.
 void setExitMethod(java.lang.Runnable exiter)
          Sets the object used to exit an application.
 void setGUI(boolean tizit)
           
 void setGUILog(boolean tizit)
           
 void setReadOnly(boolean tizit)
           
 void setUserHomeDir(boolean tizit)
           
static AppEnvironment singleton()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppEnvironment

public AppEnvironment()
Method Detail

singleton

public static AppEnvironment singleton()

addExitCommand

public void addExitCommand(java.lang.Runnable command)
Add an exit command. These are executed upon the next exitApp() call.


exitApp

public void exitApp()
Exit the application. Generally exits java too, but might not (e.g. when running from BusyBox) so clean up for GC, shut down threads, etc. before you call this.


exitAppWithError

public void exitAppWithError()
Exit the application. Generally exits java too, but might not (e.g. when running from BusyBox) so clean up for GC, shut down threads, etc. before you call this.


processCommandLine

public PropMap processCommandLine(java.lang.String syntaxPath,
                                  java.lang.String[] args)
Get command-line arguments as a PropMap.


disableSystemExit

public void disableSystemExit()

enableSystemExit

public void enableSystemExit()

isReadOnly

public boolean isReadOnly()
If true, app is running in a read-only environment (CDROM or demo mode).


setReadOnly

public void setReadOnly(boolean tizit)

setExitMethod

public void setExitMethod(java.lang.Runnable exiter)
Sets the object used to exit an application. Allows overriding. Default is a System.exit(0).


getExitMethod

public java.lang.Runnable getExitMethod()

getBuildNumber

public java.lang.String getBuildNumber()
Returns the build number (a six-digit date plus alphabetic sequence).


getJREDescription

public java.lang.String getJREDescription()
Returns a description of the current JRE.


getOSDescription

public java.lang.String getOSDescription()
Returns a description of the current operating system.


isLinux

public boolean isLinux()

getCopyrightNotice

public java.lang.String getCopyrightNotice()
Returns a Partner copyright notice.


getPhoneNumber

public java.lang.String getPhoneNumber()
Returns the Partner phone number.


getWebsite

public java.lang.String getWebsite()
Returns a Partner web URL.


isGUI

public boolean isGUI()

getLastAppExitedWithError

public boolean getLastAppExitedWithError()

setGUI

public void setGUI(boolean tizit)

setGUILog

public void setGUILog(boolean tizit)

isGUILog

public boolean isGUILog()

getUseHomeDir

public boolean getUseHomeDir()

setUserHomeDir

public void setUserHomeDir(boolean tizit)