[infinispan-issues] [JBoss JIRA] (ISPN-2181) Allow to inject the current cache into Mapper/Reducer/Callable objects

Vladimir Blagojevic (JIRA) jira-events at lists.jboss.org
Sun Aug 5 05:28:07 EDT 2012


    [ https://issues.jboss.org/browse/ISPN-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709882#comment-12709882 ] 

Vladimir Blagojevic commented on ISPN-2181:
-------------------------------------------

This was not trivial at all and we had to involve Pete :-) So the idea is that we will create a custom qualifier, say @ImpliedInputTaskCache or whatever you want to call it and annotate Cache field in addition to @Inject annotation.  


Transcript:

pmuir: so 1) implement Bean (utilities in Solder make this easy  - BeanBuilder is the one to look at, and you specify a ContextualLifecycle to it, which is where you do the magic extraction from cc)
[7:01pm] pmuir: 2) in the extensions, AfterBeanDiscovery, register your custom bean
[7:01pm] pmuir: 3) in the *Lifecycle, put the Cache into the CreationalContext
[7:04pm] vblagoje: pmuir:  thats it? it is not going to interfere with current mechanism in Infinispan CDI which currently injects default cache?
[7:05pm] vblagoje: ok I will into this tomorrow;  it sounds like an interesting task! Thanks pmuir
[7:07pm] pmuir: vblagoje: not if you use a custom qualifier
[7:07pm] pmuir: yeah I guess add  0) create @Blah qualifier
                
> Allow to inject the current cache into Mapper/Reducer/Callable objects
> ----------------------------------------------------------------------
>
>                 Key: ISPN-2181
>                 URL: https://issues.jboss.org/browse/ISPN-2181
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: CDI integration
>    Affects Versions: 5.1.5.FINAL, 5.2.0.ALPHA2
>            Reporter: Nicolas Filotto
>            Assignee: Vladimir Blagojevic
>             Fix For: 5.2.0.ALPHA4, 5.2.0.FINAL
>
>
> Thanks to ISPN-1636, it is now possible to inject the cache into Mapper/Reducer/Callable objects however the cache injected is the default cache not the cache for which the MapReduceTask/DistributedExecutorService has been created which is quite error prone since we don't expect to get the default cache but the current cache.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list