Search in sources :

Example 1 with IManager

use of com.gitblit.manager.IManager in project gitblit by gitblit.

the class GitblitContext method destroyContext.

/**
 * Gitblit is being shutdown either because the servlet container is
 * shutting down or because the servlet container is re-deploying Gitblit.
 */
protected void destroyContext(ServletContext context) {
    logger.info("Gitblit context destroyed by servlet container.");
    IPluginManager pluginManager = getManager(IPluginManager.class);
    if (pluginManager != null) {
        for (LifeCycleListener listener : pluginManager.getExtensions(LifeCycleListener.class)) {
            try {
                listener.onShutdown();
            } catch (Throwable t) {
                logger.error(null, t);
            }
        }
    }
    for (IManager manager : managers) {
        logger.debug("stopping {}", manager.getClass().getSimpleName());
        manager.stop();
    }
}
Also used : IManager(com.gitblit.manager.IManager) IPluginManager(com.gitblit.manager.IPluginManager) LifeCycleListener(com.gitblit.extensions.LifeCycleListener)

Aggregations

LifeCycleListener (com.gitblit.extensions.LifeCycleListener)1 IManager (com.gitblit.manager.IManager)1 IPluginManager (com.gitblit.manager.IPluginManager)1