Interface IInitializer

  • All Known Implementing Classes:
    DebugBarInitializer, Initializer, Initializer, Initializer, Initializer, Initializer, Initializer, Initializer, Initializer, UploadProgressBar.ComponentInitializer

    public interface IInitializer
    Initializes something when application loads.

    Initializer can be used for clustering. Lets say you access a page that has a link to a resource on node A now the url for the resource gets forwarded to node B, but node B doesn't have the resource registered yet because maybe the page class hasn't been loaded and so its static block hasn't run yet. So the initializer is a place for you to register all those resources and do all the stuff you used to do in the static blocks.

    You don't have to pre-register package resources, as they can be initialized lazily.

    Initializers can be configured via ServiceLoader, i.e. by having a file /META-INF/services/org.apache.wicket.IInitializer in the class path root, with each line containing the full class name of an IInitializer.

    Author:
    Jonathan Locke
    • Method Detail

      • init

        void init​(Application application)
        Parameters:
        application - The application loading the component
      • destroy

        void destroy​(Application application)
        Parameters:
        application - The application loading the component