Thread th = Thread.currentThread();
if(perthr.containsKey(th))
return(perthr.get(th));
- ThreadContext ctx = getctx();
+ ThreadContext ctx = ThreadContext.current();
if(perctx.containsKey(ctx))
return(perctx.get(ctx));
if(!bound)
}
public synchronized T ctxset(T val) {
- ThreadContext ctx = getctx();
+ ThreadContext ctx = ThreadContext.current();
return(perctx.put(ctx, val));
}
- private static ThreadContext getctx() {
- for(ThreadGroup tg = Thread.currentThread().getThreadGroup(); tg != null; tg = tg.getParent()) {
- if(tg instanceof ThreadContext)
- return((ThreadContext)tg);
- }
- return(null);
- }
-
public static Responder let(final Responder next, Object... params) {
final Map<ContextParam, Object> values = new HashMap<ContextParam, Object>();
if((params.length % 2) != 0)