@Override public void activate() { super.activate(); getBeanStore().attach(); }
@Override public void deactivate() { getBeanStore().detach(); super.deactivate(); }
@Override public Collection<ContextualInstance<?>> getAllContextualInstances() { Set<ContextualInstance<?>> result = new HashSet<>(); // for instance lazily initialized conversation scope may be active but have null here BeanStore beanStore = getBeanStore(); if (beanStore != null) { getBeanStore().iterator().forEachRemaining((BeanIdentifier beanId) -> { result.add(getBeanStore().get(beanId)); }); } return result; }
protected void destroyConversation(S session, String id) { if (session != null) { conversationBeforeDestroyedEvent.get().fire(id); setBeanStore(createSessionBeanStore(new ConversationNamingScheme(getNamingSchemePrefix(), id, beanIdentifierIndex), session)); getBeanStore().attach(); destroy(); getBeanStore().detach(); setBeanStore(null); conversationDestroyedEvent.get().fire(id); } }
@Override public void clearAndSet(Collection<ContextualInstance<?>> setOfInstances) { // bound context can be multithreaded, in such case we perform locking BoundBeanStore boundBeanStore = getBeanStore(); boundBeanStore.clear(); for (ContextualInstance<?> contextualInstance : setOfInstances) { BeanIdentifier id = getId(contextualInstance.getContextual()); LockedBean lock = null; try { if (isMultithreaded()) { lock = boundBeanStore.lock(id); } getBeanStore().put(getId(contextualInstance.getContextual()), contextualInstance); } finally { if (lock != null) { lock.unlock(); } } } } }
if (!getBeanStore().isAttached()) { .getId()); getBeanStore().attach(); getConversationMap().put(getCurrentConversation().getId(), getCurrentConversation());
protected void destroyConversation(S session, String id) { if (session != null) { conversationBeforeDestroyedEvent.get().fire(id); setBeanStore(createSessionBeanStore(new ConversationNamingScheme(getNamingSchemePrefix(), id, beanIdentifierIndex), session)); getBeanStore().attach(); destroy(); getBeanStore().detach(); setBeanStore(null); conversationDestroyedEvent.get().fire(id); } }
@Override public void clearAndSet(Collection<ContextualInstance<?>> setOfInstances) { // bound context can be multithreaded, in such case we perform locking BoundBeanStore boundBeanStore = getBeanStore(); boundBeanStore.clear(); for (ContextualInstance<?> contextualInstance : setOfInstances) { BeanIdentifier id = getId(contextualInstance.getContextual()); LockedBean lock = null; try { if (isMultithreaded()) { lock = boundBeanStore.lock(id); } getBeanStore().put(getId(contextualInstance.getContextual()), contextualInstance); } finally { if (lock != null) { lock.unlock(); } } } } }
if (!getBeanStore().isAttached()) { .getId()); getBeanStore().attach(); getConversationMap().put(getCurrentConversation().getId(), getCurrentConversation());
protected void destroyConversation(S session, String id) { if (session != null) { conversationBeforeDestroyedEvent.get().fire(id); setBeanStore(createSessionBeanStore(new ConversationNamingScheme(getNamingSchemePrefix(), id, beanIdentifierIndex), session)); getBeanStore().attach(); destroy(); getBeanStore().detach(); setBeanStore(null); conversationDestroyedEvent.get().fire(id); } }
@Override public void clearAndSet(Collection<ContextualInstance<?>> setOfInstances) { // bound context can be multithreaded, in such case we perform locking BoundBeanStore boundBeanStore = getBeanStore(); boundBeanStore.clear(); for (ContextualInstance<?> contextualInstance : setOfInstances) { BeanIdentifier id = getId(contextualInstance.getContextual()); LockedBean lock = null; try { if (isMultithreaded()) { lock = boundBeanStore.lock(id); } getBeanStore().put(getId(contextualInstance.getContextual()), contextualInstance); } finally { if (lock != null) { lock.unlock(); } } } } }
@Override public void activate() { super.activate(); getBeanStore().attach(); }
if (!getBeanStore().isAttached()) { .getId()); getBeanStore().attach(); getConversationMap().put(getCurrentConversation().getId(), getCurrentConversation());
@Override public Collection<ContextualInstance<?>> getAllContextualInstances() { Set<ContextualInstance<?>> result = new HashSet<>(); // for instance lazily initialized conversation scope may be active but have null here BeanStore beanStore = getBeanStore(); if (beanStore != null) { getBeanStore().iterator().forEachRemaining((BeanIdentifier beanId) -> { result.add(getBeanStore().get(beanId)); }); } return result; }
@Override public void invalidate() { super.invalidate(); getBeanStore().detach(); } }
protected void destroyConversation(S session, String id) { if (session != null) { conversationBeforeDestroyedEvent.get().fire(id); setBeanStore(createSessionBeanStore(new ConversationNamingScheme(getNamingSchemePrefix(), id, beanIdentifierIndex), session)); getBeanStore().attach(); destroy(); getBeanStore().detach(); setBeanStore(null); conversationDestroyedEvent.get().fire(id); } }
@Override public void clearAndSet(Collection<ContextualInstance<?>> setOfInstances) { BoundBeanStore boundBeanStore = getBeanStore(); // for instance lazily initialized conversation scope may be active but have null here if (boundBeanStore != null) { boundBeanStore.clear(); for (ContextualInstance<?> contextualInstance : setOfInstances) { // bound context can be multithreaded, in such case we perform locking BeanIdentifier id = getId(contextualInstance.getContextual()); LockedBean lock = null; try { if (isMultithreaded()) { lock = boundBeanStore.lock(id); } getBeanStore().put(getId(contextualInstance.getContextual()), contextualInstance); } finally { if (lock != null) { lock.unlock(); } } } } } }
@Override public void activate() { super.activate(); getBeanStore().attach(); }
if (!getBeanStore().isAttached()) { .getId()); getBeanStore().attach(); getConversationMap().put(getCurrentConversation().getId(), getCurrentConversation());
@Override public Collection<ContextualInstance<?>> getAllContextualInstances() { Set<ContextualInstance<?>> result = new HashSet<>(); // for instance lazily initialized conversation scope may be active but have null here BeanStore beanStore = getBeanStore(); if (beanStore != null) { getBeanStore().iterator().forEachRemaining((BeanIdentifier beanId) -> { result.add(getBeanStore().get(beanId)); }); } return result; }