public boolean associate(HttpServletRequest request) { // At this point the bean store should never be set - see also HttpContextLifecycle.nestedInvocationGuard if (getBeanStore() != null) { ContextLogger.LOG.beanStoreLeakDuringAssociation(this.getClass().getName(), request); } // We always associate a new bean store to avoid possible leaks (security threats) setBeanStore(new LazySessionBeanStore(request, namingScheme, getServiceRegistry().getRequired(WeldConfiguration.class).getBooleanProperty( ConfigurationKey.CONTEXT_ATTRIBUTES_LAZY_FETCH), getServiceRegistry())); checkBeanIdentifierIndexConsistency(request); return true; }
public boolean associate(HttpServletRequest request) { // At this point the bean store should never be set - see also HttpContextLifecycle.nestedInvocationGuard if (getBeanStore() != null) { ContextLogger.LOG.beanStoreLeakDuringAssociation(this.getClass().getName(), request); } // We always associate a new bean store to avoid possible leaks (security threats) setBeanStore(new LazySessionBeanStore(request, namingScheme, getServiceRegistry().getRequired(WeldConfiguration.class).getBooleanProperty( ConfigurationKey.CONTEXT_ATTRIBUTES_LAZY_FETCH), getServiceRegistry())); checkBeanIdentifierIndexConsistency(request); return true; }
public boolean associate(HttpServletRequest request) { // At this point the bean store should never be set - see also HttpContextLifecycle.nestedInvocationGuard if (getBeanStore() != null) { ContextLogger.LOG.beanStoreLeakDuringAssociation(this.getClass().getName(), request); } // We always associate a new bean store to avoid possible leaks (security threats) setBeanStore(new LazySessionBeanStore(request, namingScheme, getServiceRegistry().getRequired(WeldConfiguration.class).getBooleanProperty( ConfigurationKey.CONTEXT_ATTRIBUTES_LAZY_FETCH), getServiceRegistry())); checkBeanIdentifierIndexConsistency(request); return true; }
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; } }