[
https://issues.jboss.org/browse/CDI-567?page=com.atlassian.jira.plugin.sy...
]
Romain Manni-Bucau commented on CDI-567:
----------------------------------------
DeltaSpike uses some thread local for transaction and data stuff. Idea is to allo to store
meta information in bean themself. We would probably desire to have two kind of
enrich-able storage:
- one on Bean (model meta)
- one on instances when possible (when proxied to make it simple) for instance related
meta
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)