Package com.jbstrap.ui
Class Startup
java.lang.Object
com.jbstrap.ui.Startup
- All Implemented Interfaces:
EventListener
,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:
- The beforeFrameworkInitialization() method is called
- Every properties file in the application are loaded
- The parameters get set by calling the parameterSettings() method
- The external plugins get loaded by calling the loadPlugins() method
- The application's DataDescriptor get loaded
- The application is initialized by calling the init() method
- The file stores get created by calling the createFileStores() method
- The data of the application pages get loaded, by calling the createPages() method
- The application menus get created by calling the createMenus() method
- 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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Method containing operations that must be executed after the framework is initialized.void
Method containing operations that must be executed before the framework is has been initialized.final void
contextDestroyed
(javax.servlet.ServletContextEvent arg0) final void
contextInitialized
(javax.servlet.ServletContextEvent servletContextEvent) void
Creates the application's file stores.void
Creates the application menu.void
Creates the application pages.abstract void
init()
The application initializationvoid
Loads external plugins.void
parameterSettings
(javax.servlet.ServletContext context) Sets the JBStrap application parameters.void
shutdown()
The application shutdown operation.
-
Constructor Details
-
Startup
public Startup()
-
-
Method Details
-
contextInitialized
public final void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent) - Specified by:
contextInitialized
in interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public final void contextDestroyed(javax.servlet.ServletContextEvent arg0) - Specified by:
contextDestroyed
in interfacejavax.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.
-