use of org.jboss.weld.contexts.beanstore.AttributeBeanStore in project core by weld.
the class HttpSessionContextImpl method destroy.
public boolean destroy(HttpSession session) {
final BoundBeanStore beanStore = getBeanStore();
if (beanStore == null) {
try {
HttpConversationContext conversationContext = getConversationContext();
setBeanStore(new EagerSessionBeanStore(namingScheme, session));
activate();
invalidate();
conversationContext.destroy(session);
deactivate();
setBeanStore(null);
return true;
} finally {
cleanup();
}
} else {
// We are in a request, invalidate it
invalidate();
if (beanStore instanceof AttributeBeanStore) {
AttributeBeanStore attributeBeanStore = ((AttributeBeanStore) beanStore);
if (attributeBeanStore.isAttributeLazyFetchingEnabled()) {
// At this moment we have to sync the local bean store and the backing store
attributeBeanStore.fetchUninitializedAttributes();
}
}
getConversationContext().destroy(session);
return false;
}
}
Aggregations