From: Bill B. <bi...@jb...> - 2005-11-17 20:38:58
|
Another benefit of ThreadMetaData is when you want to propagate threadlocal data to child threads, specifically when you make an asynchronous invocation. EJB3 (and AOP Remoting) has the notion of asynchronous proxies. What is a pain is that I have to know exactly how to propagate the TX and Security (or any other threadlocal) to the spawned thread (or pooled thread) the asynch request is going on. If all components stuffed their information in ThreadMetaData, this would make things easier. Bill Bill Burke wrote: > ThreadMetaData.instance().clear() > > Scott M Stark wrote: > >> The semantic I'm looking for is to be able to do a: >> >> JBossThreadLocal.clear() >> >> and have all JBossThreadLocals associated with the current thread >> cleared. It does not look like the ThreadMetaData does this? Really I >> should submit a feature request for a >> java.lang.Thread.clearThreadLocals(). Maybe I can get it into jdk6 if >> I write it. >> >> Bill Burke wrote: >> >>> org.jboss.aop.metadata.ThreadMetaData >>> >>> >>> Adrian Brock wrote: >>> >>>> On Wed, 2005-11-16 at 20:48, Scott M Stark wrote: >>>> >>>>> Problem is, I don't see how this can be done without a custom >>>>> ThreadLocal. >>>> >>>> >>>> >>>> >>>> I think this would be preferable. >>>> It would then be trivial to do ThreadLocal.clear(); >>>> at "end of request". >>>> >>>> Leaking ThreadLocals is also a memory leak and a potential security >>>> issue. >>> >>> >>> >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by the JBoss Inc. Get Certified Today >> Register for a JBoss Training Course. Free Certification Exam >> for All Training Attendees Through End of 2005. For more info visit: >> http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click >> _______________________________________________ >> JBoss-Development mailing list >> JBo...@li... >> https://lists.sourceforge.net/lists/listinfo/jboss-development >> > -- Bill Burke Chief Architect JBoss Inc. |