*/
public void onEvent(WebAppEvent event)
{
if (event instanceof WebAppLifeCycleEvent && !stopping.get())
{
WebAppLifeCycleEvent waEvent = (WebAppLifeCycleEvent)event;
if (waEvent.getType() == WebAppLifeCycleEvent.REMOVED)
{
String contextName = event.getWebApp().getServletContext().getServletContextName();
boolean updated = false;
for (Entry<String, ConcurrentMap<String, Queue<PortalContainerInitTaskContext>>> entry : initTasks.entrySet())
{
String portalContainer = entry.getKey();
ConcurrentMap<String, Queue<PortalContainerInitTaskContext>> queues = entry.getValue();
for (Queue<PortalContainerInitTaskContext> queue : queues.values())
{
for (Iterator<PortalContainerInitTaskContext> it = queue.iterator(); it.hasNext();)
{
PortalContainerInitTaskContext context = it.next();
if (context.getServletContextName().equals(contextName))
{
it.remove();
portalContainer2Reload.add(portalContainer);
updated = true;
lastUpdateTime.set(System.currentTimeMillis());
}
}
}
}
if (updated)
{
LOG.info("The webapp '" + contextName + "' has been undeployed, the related init tasks have been removed");
}
}
else if (waEvent.getType() == WebAppLifeCycleEvent.ADDED && lastUpdateTime.get() > 0 && reloadingThread == null)
{
// Reloading thread used to reload asynchronously the containers
reloadingThread = new Thread("Reloading")
{
@Override