Class MetacatInitializer

java.lang.Object
edu.ucsb.nceas.metacat.startup.MetacatInitializer
All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener

@WebListener public class MetacatInitializer extends Object implements javax.servlet.ServletContextListener
A class to initialize Metacat
Author:
tao
  • Field Details

  • Constructor Details

    • MetacatInitializer

      public MetacatInitializer()
  • Method Details

    • contextInitialized

      public void contextInitialized(javax.servlet.ServletContextEvent sce)
      An implementation of ServletContextListener that is called automatically by the servlet container on startup, and used to verify that we have the essential components in place and Metacat is initialized. So it can run successfully.
      Specified by:
      contextInitialized in interface javax.servlet.ServletContextListener
      Parameters:
      ServletContextEvent - the ServletContextEvent object will be used in Metacat
    • contextDestroyed

      public void contextDestroyed(javax.servlet.ServletContextEvent sce)
      Specified by:
      contextDestroyed in interface javax.servlet.ServletContextListener
    • initAfterMetacatConfig

      protected void initAfterMetacatConfig() throws ServiceException, javax.servlet.ServletException, edu.ucsb.nceas.utilities.PropertyNotFoundException, SQLException, edu.ucsb.nceas.utilities.UtilException
      Initialize the remainder of Metacat. This is the part that can only be initialized after metacat properties have been configured.
      Throws:
      ServiceException
      javax.servlet.ServletException
      edu.ucsb.nceas.utilities.PropertyNotFoundException
      SQLException
      edu.ucsb.nceas.utilities.UtilException
    • initializeSitemapTask

      public static void initializeSitemapTask()
      Schedule a site map task
    • scheduleSitemapGeneration

      protected static void scheduleSitemapGeneration()
      Schedule the sitemap generator to run periodically and update all of the sitemap files for search indexing engines
    • startIndexReGenerator

      protected static void startIndexReGenerator()
      Start to re-generate indexes for those haven't been indexed in another thread. It will create a timer to run this task periodically. If the property of "index.regenerate.interval" is less than 0, the thread would NOT run.
    • isFullyInitialized

      public static boolean isFullyInitialized()
      Get the status of full-initialization.
      Returns:
      true if the Metacat instance is fully initialized; false otherwise.