String type = event.getType();
if (Lifecycle.BEFORE_STOP_EVENT.equals(type)
|| Lifecycle.STOP_EVENT.equals(type)
|| Lifecycle.AFTER_STOP_EVENT.equals(type))
{
Lifecycle source = event.getLifecycle();
boolean removed;
if (source instanceof ManagerBase)
{
removed = activeManagers.remove(((ManagerBase)source).getObjectName());
}
else if (source instanceof JBossManager)
{
removed = activeManagers.remove(((JBossManager)source).getObjectName());
}
else
{
removed = activeManagers.remove(source);
}
if (removed)
{
source.removeLifecycleListener(this);
getContainer().getLogger().debug("ClusteredSSO: removed stopped " +
"manager " + source.toString());
}
// TODO consider getting the sessions and removing any from our sso's
// Idea is to cleanup after managers that don't destroy sessions