I remembered seeing Pete's message a few weeks back about the new 
ThreadContext code so I thought I would check it out when I was revamping a 
piece of my project that uses ThreadLocal's (the never-ending quest to use 
avalon to its fullest :)

Maybe I'm missing something here, I can't see how to read data from a 
ThreadContext.

You create a new ThreadContext (MyTC) by using its 2-part constructor that 
takes a policy and a Map. The ThreadContext class uses the policy to 
validate all items in the Map before propogating them to its own internal Map.

I would then take MyTC and use ThreadContext.setThreadContext() to assign 
it to the current thread. (Stored in the internal InheritableThreadLocal).

I can then also retrieve MyTC by using ThreadContext.getThreadContext().. 
but then what? There isn't any way to get at the internal Map of my data 
that I can see.

Pete, I'm not sure what your vision was for accessing the data in that map, 
be it exposing a ThreadContextAccessor or what. If you tell me what you 
want it to do, I can write the code.
-pete

-- 
peter royal -> [EMAIL PROTECTED]
managing partners, inc. -> http://www.managingpartners.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to