[cdi-dev] [JBoss JIRA] (CDI-567) Investigate user data holding in instances

Romain Manni-Bucau (JIRA) issues at jboss.org
Tue Oct 27 11:04:00 EDT 2015


Romain Manni-Bucau created CDI-567:
--------------------------------------

             Summary: 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)


More information about the cdi-dev mailing list