当前位置: 首页>>代码示例>>Java>>正文


Java AbstractContext类代码示例

本文整理汇总了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;
            }
        }
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:21,代码来源:GroupedConversationContext.java

示例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
            }
        }
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:17,代码来源:ViewAccessContext.java

示例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;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:22,代码来源:WindowContextImpl.java

示例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);
		}
	}
}
 
开发者ID:dansiviter,项目名称:cito,代码行数:15,代码来源:WebSocketContext.java

示例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);
    }
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:11,代码来源:AbstractBeanHolder.java

示例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;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:14,代码来源:GroupedConversationContext.java

示例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;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:41,代码来源:GroupedConversationContext.java

示例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);
    }
}
 
开发者ID:canoo,项目名称:dolphin-platform,代码行数:7,代码来源:ClientScopeContext.java


注:本文中的org.apache.deltaspike.core.util.context.AbstractContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。