Enumeration<String> names = event.getSession().getAttributeNames();
while (names.hasMoreElements()) {
String name = names.nextElement();
Object attribute = event.getSession().getAttribute(name);
if (attribute instanceof ContextualInstance) {
ContextualInstance s = (ContextualInstance)attribute;
if (s.getInstance() instanceof PlanManager){
// unlock all plans opened and locked in this session
PlanManager planManager = (PlanManager) s.getInstance();
planManager.unlockSessionPlans();
}
}
}
}