Interface Initialization

  • All Known Implementing Classes:
    SASServletInitializer

    public interface Initialization
    The reason this class exists is because of Java single-inheritence. A top-level servlet class has an init() method that is called. However, if there are many subclasses of this it can be very hard to change their initialization without over-riding several classes or doing something very odd, such as extending a single subclass to do nothing but over-ride its parent then putting in machinery to prevent the parent from running its init method. Hardly ideal.This interface decouples initialization from the servlet. The Bootstrapper is tasked with making the correct instance of this class which is then injected into the servlet statically on boot. This in turn is called in the servlet init method.

    This solves issue OAUTH-112.

    Created by Jeff Gaynor
    on 4/15/14 at 10:24 AM

    • Method Detail

      • init

        void init()
           throws javax.servlet.ServletException
        This should handle all initialization tasks for a servlet. Set the environment before use.
        Throws:
        javax.servlet.ServletException
      • getServlet

        AbstractServlet getServlet()
        Many initialization tasks can only be done dynamically, after the servlet has been created and its ServletContext set. There has to be a back reference to or you cannot completely control servlet startup.
        Returns: