/* Author: Jeff Dalton * Updated: Sun May 6 21:59:17 2001 by Jeff Dalton * Copyright: (c) 2001, AIAI, University of Edinburgh */ package ix.util.context; import java.util.*; /** * A context-holding strategy that associates context-holders with * threads, with inheritance from the parent thread. Although the * holder for a thread is inherited from the thread's parent, it * may be explicitly set to a different value. */ public class InheritableThreadLocalHoldingStrategy extends ThreadLocalHoldingStrategy { ThreadLocal threadContextHolder; public InheritableThreadLocalHoldingStrategy() { threadContextHolder = new InheritableThreadLocal(); } public ContextHolder getContextHolder() { return (ContextHolder)threadContextHolder.get(); } public void setContextHolder(ContextHolder h) { threadContextHolder.set(h); } }