org.eodisp.util
Class AbstractAppModule

java.lang.Object
  extended by org.eodisp.util.AbstractAppModule
All Implemented Interfaces:
AppModule

public abstract class AbstractAppModule
extends java.lang.Object
implements AppModule

Provides an implementation of an AppModule with empty stubs for methods that are allowed to do nothing.

Version:
$Id:$
Author:
ibirrer

Constructor Summary
AbstractAppModule()
           
 
Method Summary
abstract  java.lang.String getId()
          Returns the unique id of this application module.
 void postShutdown(RootApp rootApp)
          Called after all application modules were shutdown.
 void preStartup(RootApp rootApp)
          This callback is invoked before the real startup.
 void registerConfiguration(RootApp rootApp)
          Gives the application module a change to register its configuration with the root application.
 void shutdown(RootApp rootApp)
          This callback indicates that this application module shall shutdown.
 void startup(RootApp rootApp)
          This callback indicates that this application module can now start.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAppModule

public AbstractAppModule()
Method Detail

getId

public abstract java.lang.String getId()
Returns the unique id of this application module.

Specified by:
getId in interface AppModule
Returns:
the unique id of this application module.

postShutdown

public void postShutdown(RootApp rootApp)
Called after all application modules were shutdown.

Specified by:
postShutdown in interface AppModule
Parameters:
rootApp - A reference to the root application

preStartup

public void preStartup(RootApp rootApp)
This callback is invoked before the real startup.

Specified by:
preStartup in interface AppModule
Parameters:
rootApp - A reference to the root application

registerConfiguration

public void registerConfiguration(RootApp rootApp)
Gives the application module a change to register its configuration with the root application.

The method RootApp.registerConfiguration(Configuration) must be called on the RootApp class to do this. If the AppModule wants to contribute any command line options, it can use the RootApp.registerConfiguration(Configuration, CommandlineMapper) instead.

The configuration that is being registered through the methods mentioned above, is automatically loaded by the root application, so do not call Configuration.load() here.

Specified by:
registerConfiguration in interface AppModule
Parameters:
rootApp - The root application. This is the instance where the register methods can be invoked.
See Also:
RootApp, Configuration

shutdown

public void shutdown(RootApp rootApp)
              throws java.lang.Exception
This callback indicates that this application module shall shutdown.

Specified by:
shutdown in interface AppModule
Parameters:
rootApp - A reference to the root application
Throws:
java.lang.Exception - Indicates that something went wrong during the application shutdown.

startup

public void startup(RootApp rootApp)
             throws java.lang.Exception
This callback indicates that this application module can now start.

In practice this means that after this method returns, the application module should be up and running. In the case of a GUI application module this probably means that the GUI is being displayed on the screen and is ready for user inputs.

Specified by:
startup in interface AppModule
Parameters:
rootApp - A reference to the root application
Throws:
java.lang.Exception - Indicates that something went wrong during the application module startup.