com.objectwave.appSupport
Class StartupRoutine

java.lang.Object
  |
  +--com.objectwave.appSupport.StartupRoutine

public class StartupRoutine
extends java.lang.Object

There are a set of things that happen in most application startups. I'm attempting to create a class that handles the most common items.

Version:
1.5

Constructor Summary
StartupRoutine()
           
 
Method Summary
static void initPersistence(java.lang.String[] args)
          If an application is going to use persistence, you may want to initialize object pooling with this routine.
static void loadDefaults(java.lang.Object obj)
           
static void loadDefaults(java.lang.Object obj, java.lang.String fileName)
          This will first look for the file as a system resource.
static void logExceptionsToFile(java.lang.String fileName)
          Setup a listener on the status manager to log any exceptions to the the file provided by file name.
static void manageTransactionWithScreenActivation()
          In order to effectively use this method, you must use the UIManager class to open ALL screens.
static void setInitializationFile(java.lang.String iniFile)
          This method should be called before the loadDefaults(Object) method is called.
static void setLookAndFeel()
          This will set the look and feel of the application to windows.
static void useObjectPool(java.lang.String fileName)
           
static void writeObjectPoolOnExit(java.lang.String fileName)
          This method will most likely be called from the initializePersistence method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StartupRoutine

public StartupRoutine()
Method Detail

initPersistence

public static void initPersistence(java.lang.String[] args)
If an application is going to use persistence, you may want to initialize object pooling with this routine. If there are no args, then we just do normal Database setup.


loadDefaults

public static void loadDefaults(java.lang.Object obj)
Parameters:
obj - The object that will be used to look for the initialization file. obj can either be an instance of something or a class.

loadDefaults

public static void loadDefaults(java.lang.Object obj,
                                java.lang.String fileName)
This will first look for the file as a system resource. This will allow one to override a file in a jar file by placing an ini file in the classpath. If a system property that starts with 'ow.' is already present at the time the file is loaded, we preserve the 'ow.' value. This allows the command line -D to override any values found in the .ini file.
Parameters:
obj - The object that will be used to look for the initialization file. obj can either be an instance of something or a class.
fileName - The file containing the properties.

logExceptionsToFile

public static void logExceptionsToFile(java.lang.String fileName)
Setup a listener on the status manager to log any exceptions to the the file provided by file name.


manageTransactionWithScreenActivation

public static void manageTransactionWithScreenActivation()
In order to effectively use this method, you must use the UIManager class to open ALL screens. When a screen is activated, the appropriate context for the transaction log will be set. This will also require all transactions to be complete prior to exiting the system.


setInitializationFile

public static void setInitializationFile(java.lang.String iniFile)
This method should be called before the loadDefaults(Object) method is called.


setLookAndFeel

public static void setLookAndFeel()
This will set the look and feel of the application to windows. It will first attempt to load the swing-0.7 windows look and feel followed by an attempt to load teh swing-1.0.1 windows look and feel.


useObjectPool

public static void useObjectPool(java.lang.String fileName)

writeObjectPoolOnExit

public static void writeObjectPoolOnExit(java.lang.String fileName)
This method will most likely be called from the initializePersistence method.