[
https://issues.jboss.org/browse/CDI-567?page=com.atlassian.jira.plugin.sy...
]
Tomas Remes commented on CDI-567:
---------------------------------
Sorry but I don't understand much. I am not really sure what you would like to
achieve. Can you elaborate please (some code example might be helpful)? Can you point me
to some extension (as an example) which uses ThreadLocal?
Investigate user data holding in instances
------------------------------------------
Key: CDI-567
URL:
https://issues.jboss.org/browse/CDI-567
Project: CDI Specification Issues
Issue Type: Feature Request
Reporter: Romain Manni-Bucau
Need: attach some data to instances
Solutions (a few I'm thinking about writing these lines):
- allow CDI extensions to register ClassFileTransformer (or a CDI interface) to modify
the bytecode of classes (I like this one since it opens a lot of awesome doors - far more
than what is needed for this task feature - and even to make CDI instances not CDI
compliant ;) but it is very technical)
- allow context to handle data associated with their instances (caricaturally: a
Map<Instance, Data> would be associated to the context and it would be accessible
either from an event - sadly we cant reuse initialized/destroyed ones - or the context
itself)
- extend all beans having a registered "DataEnricher" to be able to handle this
and make it inherit from a new interface "DataGetSet" (the name is horrible but
it is to share the idea ;))
Main goal is to get rid of all the ThreadLocals CDI extensions can need when writing not
final applications (= make libraries writer's lifes easier) on one side and to make
easier to associate a model to an instance on another side (=avoid to redo the same in all
extensions).
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)