class AMSetupFilter implements Filter {

    @Override
    public void init(FilterConfig config) throws ServletException {
        // Initialise the OpenAM Time enum.
        System.out.println("Starting up OpenAM at " +
                DateFormat.getDateTimeInstance().format(Time.getCalendarInstance().getTime()));
        ServletContext servletContext = config.getServletContext();
        SystemStartupInjectorHolder startupInjectorHolder = SystemStartupInjectorHolder.getInstance();
        setupManager = startupInjectorHolder.getInstance(AMSetupManager.class);
        if (!setupManager.isConfigured()) {
            // TASK TODO figure out if and why we need to do this here
            servletContext.setAttribute(AM_ENCRYPTION_PASSWORD_PROPERTY_KEY, AMSetupUtils.getRandomString());
        }
    }

}