Class Startup

java.lang.Object
com.jbstrap.ui.Startup
All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener

public abstract class Startup extends Object implements javax.servlet.ServletContextListener

The application startup class

Every JBStrap application must have a class that extends from this class. On the application startup (server start, or application installation) this class will be the first to run. The application's basic settings will also be initialized.

The entity methods of the class can be overwritten to execute certain operations during the startup process. These entity methods and their purpose are described below.

The following operations will be executed automatically, when the JBStrap framework starts up:

  1. The beforeFrameworkInitialization() method is called
  2. Every properties file in the application are loaded
  3. The parameters get set by calling the parameterSettings() method
  4. The external plugins get loaded by calling the loadPlugins() method
  5. The application's DataDescriptor get loaded
  6. The application is initialized by calling the init() method
  7. The file stores get created by calling the createFileStores() method
  8. The data of the application pages get loaded, by calling the createPages() method
  9. The application menus get created by calling the createMenus() method
  10. The afterFrameworkInitialization method is called

If the application is shut down, the shutdown() method is called. The application shutdown implementation can be placed there.

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • Startup

      public Startup()
  • Method Details

    • contextInitialized

      public final void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
      Specified by:
      contextInitialized in interface javax.servlet.ServletContextListener
    • contextDestroyed

      public final void contextDestroyed(javax.servlet.ServletContextEvent arg0)
      Specified by:
      contextDestroyed in interface javax.servlet.ServletContextListener
    • parameterSettings

      public void parameterSettings(javax.servlet.ServletContext context)
      Sets the JBStrap application parameters. By default, the method is empty, the application must overwrite it in order to set the parameters.
      Parameters:
      context - The servlet context where the application is running
    • createFileStores

      public void createFileStores()
      Creates the application's file stores. By default, the method is empty, the application must overwrite it in order to create the file stores.
    • loadPlugins

      public void loadPlugins()
      Loads external plugins. By default, the method is empty, the application must overwrite it in order to load plugins
    • createPages

      public void createPages()
      Creates the application pages. By default, the method is empty, the application must overwrite it in order to create the pages
    • createMenus

      public void createMenus()
      Creates the application menu. By default, the method is empty, the application must overwrite it in order to create menus
    • init

      public abstract void init()
      The application initialization
    • shutdown

      public void shutdown()
      The application shutdown operation. By default, the method is empty, the application must overwrite it in order to handle the shutdown event.
    • beforeFrameworkInitialization

      public void beforeFrameworkInitialization()
      Method containing operations that must be executed before the framework is has been initialized. By default, the method is empty, the application must overwrite it in order to run operations before the framework is initialized.
    • afterFrameworkInitialization

      public void afterFrameworkInitialization()
      Method containing operations that must be executed after the framework is initialized. By default, the method is empty, the application must overwrite it in order to run operations after the framework is initialized.