Class Bootstrap

java.lang.Object
org.javalite.activeweb.Bootstrap
All Implemented Interfaces:
InitConfig

public abstract class Bootstrap extends Object implements InitConfig
This is an abstract class designed to be overridden in the application. The name for a subclass is: app.config.AppBootstrap. This class is called by the framework during initialization.
Author:
Igor Polevoy
See Also:
AbstractDBConfig, AbstractControllerConfig
  • Constructor Details

    • Bootstrap

      public Bootstrap()
  • Method Details

    • init

      public abstract void init(AppContext context)
      Called when application bootstraps.
      Specified by:
      init in interface InitConfig
      Parameters:
      context - app context instance
    • destroy

      public void destroy(AppContext context)
      Called when application is destroyed (un-deployed). Override to catch event.
      Parameters:
      context - app context instance
    • getInjector

      public com.google.inject.Injector getInjector()
      Subclasses need to override this method to return instance of Injector to use for dependency injection.

      This method is NOT USED during testing. Each test class will set its own injector with mocks for testing.

      It is important to not create a new instance of injector each time this method is called, but rather than return the same instance.

      No synchronization is needed because the first time this method is used, it is done in one thread.

      Returns:
      instance of Injector to use to inject dependencies into controllers, filters and tags.