本文整理匯總了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;
}