本文整理汇总了Java中org.apache.deltaspike.core.util.context.AbstractContext类的典型用法代码示例。如果您正苦于以下问题:Java AbstractContext类的具体用法?Java AbstractContext怎么用?Java AbstractContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractContext类属于org.apache.deltaspike.core.util.context包,在下文中一共展示了AbstractContext类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tryToDestroySubGroup
import org.apache.deltaspike.core.util.context.AbstractContext; //导入依赖的package包/类
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;
}
}
}
}
示例2: destroyExpiredBeans
import org.apache.deltaspike.core.util.context.AbstractContext; //导入依赖的package包/类
private void destroyExpiredBeans(boolean force)
{
ContextualStorage storage = viewAccessBeanHolder.getContextualStorage(beanManager, KEY, false);
if (storage != null)
{
for (Map.Entry<Object, ContextualInstanceInfo<?>> storageEntry : storage.getStorage().entrySet())
{
if (force || !viewAccessBeanAccessHistory.getAccessedBeans().contains((String) storageEntry.getKey()))
{
Contextual bean = storage.getBean(storageEntry.getKey());
AbstractContext.destroyBean(bean, storageEntry.getValue());
storage.getStorage().remove(storageEntry.getKey()); //ok due to ConcurrentHashMap
}
}
}
}
示例3: closeWindow
import org.apache.deltaspike.core.util.context.AbstractContext; //导入依赖的package包/类
@Override
public boolean closeWindow(String windowId)
{
if (windowId == null)
{
return false;
}
ContextualStorage windowStorage = windowBeanHolder.getStorageMap().remove(windowId);
if (windowStorage != null)
{
if (windowId.equals(this.windowIdHolder.getWindowId()))
{
this.windowIdHolder.setWindowId(null);
}
AbstractContext.destroyAllActive(windowStorage);
}
return windowStorage != null;
}
示例4: dispose
import org.apache.deltaspike.core.util.context.AbstractContext; //导入依赖的package包/类
/**
* Disposes all beans associated with the {@link Session}.
*
* @param session
*/
public void dispose(Session session) {
this.log.debug("Disposing scope. [sessionId={}]", session.getId());
try (QuietClosable c = activate(session)) {
final ContextualStorage storage = getContextualStorage(null, false);
if (storage != null) {
AbstractContext.destroyAllActive(storage);
}
}
}
示例5: destroyBeans
import org.apache.deltaspike.core.util.context.AbstractContext; //导入依赖的package包/类
@PreDestroy
public void destroyBeans()
{
Map<K, ContextualStorage> oldWindowContextStorages = forceNewStorage();
for (ContextualStorage contextualStorage : oldWindowContextStorages.values())
{
AbstractContext.destroyAllActive(contextualStorage);
}
}
示例6: closeConversation
import org.apache.deltaspike.core.util.context.AbstractContext; //导入依赖的package包/类
@Override
public ContextualStorage closeConversation(Class<?> conversationGroup, Annotation... qualifiers)
{
ConversationKey conversationKey = new ConversationKey(conversationGroup, qualifiers);
ContextualStorage contextualStorage = this.conversationBeanHolder.getStorageMap().remove(conversationKey);
if (contextualStorage != null)
{
AbstractContext.destroyAllActive(contextualStorage);
}
return contextualStorage;
}
示例7: closeConversationGroup
import org.apache.deltaspike.core.util.context.AbstractContext; //导入依赖的package包/类
@Override
public Set<ContextualStorage> closeConversationGroup(Class<?> conversationGroup)
{
Set<ContextualStorage> result = new HashSet<ContextualStorage>();
ConversationSubGroup conversationSubGroup = conversationGroup.getAnnotation(ConversationSubGroup.class);
Set<Class<?>> subGroups = null;
if (conversationSubGroup != null)
{
conversationGroup = ConversationUtils.getDeclaredConversationGroup(conversationGroup);
subGroups = new HashSet<Class<?>>(conversationSubGroup.subGroup().length);
Collections.addAll(subGroups, conversationSubGroup.subGroup());
}
Map<ConversationKey, ContextualStorage> storageMap = this.conversationBeanHolder.getStorageMap();
for (Map.Entry<ConversationKey, ContextualStorage> entry : storageMap.entrySet())
{
if (entry.getKey().getConversationGroup().equals(conversationGroup))
{
if (subGroups == null)
{
AbstractContext.destroyAllActive(entry.getValue());
result.add(entry.getValue());
storageMap.remove(entry.getKey()); //ok due to ConcurrentHashMap
}
else
{
tryToDestroySubGroup(subGroups, entry);
if (entry.getValue().getStorage().isEmpty())
{
storageMap.remove(entry.getKey()); //ok due to ConcurrentHashMap
}
}
}
}
return result;
}
示例8: destroy
import org.apache.deltaspike.core.util.context.AbstractContext; //导入依赖的package包/类
public void destroy() {
Object val = getDolphinSession().getAttribute(CLIENT_STORAGE_ATTRIBUTE);
if(val != null && val instanceof ContextualStorage) {
AbstractContext.destroyAllActive((ContextualStorage) val);
}
}