Package edu.ucsb.nceas.metacat.startup
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
contextDestroyed
(javax.servlet.ServletContextEvent sce) 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.protected void
Initialize the remainder of Metacat.static void
Schedule a site map taskstatic boolean
Get the status of full-initialization.protected static void
Schedule the sitemap generator to run periodically and update all of the sitemap files for search indexing enginesprotected static void
Start to re-generate indexes for those haven't been indexed in another thread.
-
Field Details
-
APPLICATION_NAME
- See Also:
-
-
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 interfacejavax.servlet.ServletContextListener
- Parameters:
ServletContextEvent
- the ServletContextEvent object will be used in Metacat
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent sce) - Specified by:
contextDestroyed
in interfacejavax.servlet.ServletContextListener
-
initAfterMetacatConfig
protected void initAfterMetacatConfig() throws ServiceException, javax.servlet.ServletException, edu.ucsb.nceas.utilities.PropertyNotFoundException, SQLException, edu.ucsb.nceas.utilities.UtilExceptionInitialize 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.
-