public Set<String> keySet() { return context.keySet(); }
public Set<String> keySet() { Set<String> allKeys = context.keySet(); Set<String> keys = new HashSet<String>(); Iterator<String> it = allKeys.iterator(); while (it.hasNext()) { String k = it.next(); if (context.getScope(k) == Scope.APPLICATION) { keys.add(k); } } return keys; }
public Collection<Object> values() { Collection<Object> values = new ArrayList<Object>(); Iterator<? extends String> it = context.keySet().iterator(); while (it.hasNext()) { String k = it.next(); if (context.getScope(k) == Scope.APPLICATION) { values.add(context.get(k)); } } return values; } }
public void clear() { Iterator<String> it = context.keySet().iterator(); while (it.hasNext()) { String k = it.next(); if (context.getScope(k) == Scope.APPLICATION) { context.remove(k); } } }
@SuppressWarnings("unchecked") public void putAll(Map<? extends String, ? extends Object> arg0) { context.putAll(arg0); if (arg0 instanceof MessageContext) { Iterator<String> iter = ((MessageContext)arg0).keySet().iterator(); while (iter.hasNext()) { String obj = iter.next(); context.setScope(obj, ((MessageContext)arg0).getScope(obj)); } } }
public boolean containsValue(Object value) { if (!context.containsValue(value)) { return false; } Iterator<String> it = context.keySet().iterator(); while (it.hasNext()) { String k = it.next(); if (context.get(k) == value && context.getScope(k) == Scope.APPLICATION) { return true; } } return false; }
protected void populateResponseContext(MessageContext ctx) { Iterator<String> iter = ctx.keySet().iterator(); Map<String, Object> respCtx = getResponseContext(); while (iter.hasNext()) { String obj = iter.next(); if (MessageContext.Scope.APPLICATION.compareTo(ctx.getScope(obj)) == 0) { respCtx.put(obj, ctx.get(obj)); } } }