In order to better illustrate my use case I created a simple app and attached it to a Jira ticket: https://issues.apache.org/jira/browse/OPENEJB-1939 In the example I use just one resource but this illustrates conceptually how I can have a common single object factory added for all my custom resource types.
Best Regards Bobby On Fri, Nov 16, 2012 at 3:15 PM, Romain Manni-Bucau <rmannibu...@gmail.com>wrote: > Hi, > > from what i know @Resource support a parameter where you can define the > type (the one of your provider) so you should be able to get a single type > > personally i'd probably go through CDI and a custom extension to be more > flexible > > maybe some more works about your use case can make it more easy and answer > > *Romain Manni-Bucau* > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>* > *Blog: **http://rmannibucau.wordpress.com/*< > http://rmannibucau.wordpress.com/> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* > *Github: https://github.com/rmannibucau* > > > > > 2012/11/16 Borislav Kapukaranov <b.kapukara...@gmail.com> > > > Hi folks, > > > > I've been puzzling over an idea for some time and figured it's time to > ask > > :) > > I have an app with where I have @Resource definitions on many fields with > > different custom types. > > Originally OpenEjb says it can't recognize the resource-ref and needs a > > service provider for it. That's fine. AFAIK, correct me if I got that > > wrong, service providers serve a signle type. > > > > However in my case I don't want to have that many service providers and > was > > looking for a way to create a generic one that can serve all my custom > > types marked with @Resource and call my factory in the background that > will > > produce the relevant instances. > > > > Is there a way to achieve that? What would you recommend? > > > > Thanks > > Bobby > > >