本文整理汇总了Java中org.apache.deltaspike.core.api.scope.WindowScoped类的典型用法代码示例。如果您正苦于以下问题:Java WindowScoped类的具体用法?Java WindowScoped怎么用?Java WindowScoped使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WindowScoped类属于org.apache.deltaspike.core.api.scope包,在下文中一共展示了WindowScoped类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attach
import org.apache.deltaspike.core.api.scope.WindowScoped; //导入依赖的package包/类
/**
* Attach to tracker field in session context
*
* @param context the context
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void attach(Object context) {
try {
Map m = (Map) ReflectionHelper.get(context, DeltaspikeContextsTransformer.CUSTOM_CONTEXT_TRACKER_FIELD);
if (!m.containsKey(WindowScoped.class.getName())) {
m.put(WindowScoped.class.getName(), new WindowContextsTracker());
LOGGER.debug("WindowContextsTracker added to context '{}'", context);
}
// Add mapping grouped conversation to window scoped
m.put(GroupedConversationScoped.class.getName(), WindowScoped.class.getName());
} catch (IllegalArgumentException e) {
LOGGER.error("Field '{}' not found in context class '{}'.", DeltaspikeContextsTransformer.CUSTOM_CONTEXT_TRACKER_FIELD,
context.getClass().getName());
}
}
示例2: getScope
import org.apache.deltaspike.core.api.scope.WindowScoped; //导入依赖的package包/类
@Override
public Class<? extends Annotation> getScope()
{
return WindowScoped.class;
}