public boolean destroy(HttpSession session) { final BoundBeanStore beanStore = getBeanStore(); if (beanStore == null) { try { HttpConversationContext conversationContext = getConversationContext(); setBeanStore(new EagerSessionBeanStore(namingScheme, session, getServiceRegistry())); 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; } }
public boolean destroy(HttpSession session) { final BoundBeanStore beanStore = getBeanStore(); if (beanStore == null) { try { HttpConversationContext conversationContext = getConversationContext(); setBeanStore(new EagerSessionBeanStore(namingScheme, session, getServiceRegistry())); 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; } }
public boolean destroy(HttpSession session) { final BoundBeanStore beanStore = getBeanStore(); if (beanStore == null) { try { HttpConversationContext conversationContext = getConversationContext(); setBeanStore(new EagerSessionBeanStore(namingScheme, session, getServiceRegistry())); 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; } }