return result;
}
private void tryToDestroySubGroup(Set<Class<?>> subGroups, Map.Entry<ConversationKey, ContextualStorage> entry)
{
ContextualStorage storage = entry.getValue();
for (Map.Entry<Object, ContextualInstanceInfo<?>> storageEntry : storage.getStorage().entrySet())
{
for (Class<?> subGroup : subGroups)
{
Class classOfEntry = storageEntry.getValue().getContextualInstance().getClass();
if (subGroup.equals(classOfEntry) ||
(subGroup.isInterface() && subGroup.isAssignableFrom(classOfEntry)))
{
Contextual bean = storage.getBean(storageEntry.getKey());
AbstractContext.destroyBean(bean, storageEntry.getValue());
storage.getStorage().remove(storageEntry.getKey()); //ok due to ConcurrentHashMap
break;
}
}
}
}