0

When would I want to use ThreadLocalListener?

asked 2013-05-06 16:20:59 +0800

digulla gravatar image digulla
502 4

updated 2013-05-06 16:21:51 +0800

I'm considering how to implement thread local beans in a project using ZK. While browsing for some ideas/answers, I stumbled over org.zkoss.zkplus.util.ThreadLocalListener and I'm wondering what this class is for.

At first glance, it seems to overwrite private fields in Spring but why?

I'm also wondering what the status of this class is; it looks like a prototype:

  • Exceptions are handled with ex.printStackTrace()
  • multi-threaded code writes to HashMaps without proper synchronization
  • the code is slow (it doesn't, for example, cache anything)
  • it relies on internals of external frameworks (like class names and internal field names).

Is this class safe for production use?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-05-09 10:47:04 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

updated 2013-05-09 10:49:03 +0800

I think it is ready for use since it seems pretty old,

Sun Jun 10 23:48:51 2007, Created by henrichen @since 2.4.1

But please test it well before useing it.

Reference

ThreadLocalListener.java

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-05-06 16:20:59 +0800

Seen: 9 times

Last updated: May 09 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More