Re: [osgi-dev] best pattern for instance factories

2012-12-20 Thread Peter Kriens
If you're worried about lots of handlers (and those handlers are coupled anyway, then you can always use generics interface Factory { T T create(ClassT c) {} } You very likely need to clean up because the objects you get from the create method are somehow tied

Re: [osgi-dev] best pattern for instance factories

2012-12-20 Thread Raymond Auge
On Thu, Dec 20, 2012 at 11:14 AM, Peter Kriens peter.kri...@aqute.bizwrote: If you're worried about lots of handlers (and those handlers are coupled anyway, then you can always use generics interface Factory { T T create(ClassT c) {} } You very likely need to clean up because the objects

Re: [osgi-dev] best pattern for instance factories

2012-12-20 Thread chris . gray
Ray, What we have is a typical event handler scenario: processEvent(Event event) { Handler[] handlers = getHandlers(key); for (Handler handler : handlers) { handler.process(event); } } I'd like to be able to use osgi to affect the handlers result set during runtime. This is a

Re: [osgi-dev] best pattern for instance factories

2012-12-20 Thread Raymond Auge
On Thu, Dec 20, 2012 at 1:44 PM, chris.g...@k-embedded-java.com wrote: Ray, What we have is a typical event handler scenario: processEvent(Event event) { Handler[] handlers = getHandlers(key); for (Handler handler : handlers) { handler.process(event); } } I'd like to

Re: [osgi-dev] best pattern for instance factories

2012-12-20 Thread Raymond Auge
I'm going to test the whiteboard approach and see if that addresses it. However, again it sounds like I may have to create an awefully large number of trackers.. like for each event case .. or perhaps not. I'll try that. Thank you all for indulging me. Sincerely, - Ray On Thu, Dec 20, 2012 at

Re: [osgi-dev] best pattern for instance factories

2012-12-20 Thread chris . gray
Raymond Auge wrote: What we have is a typical event handler scenario: processEvent(Event event) { Handler[] handlers = getHandlers(key); for (Handler handler : handlers) { handler.process(event); } } I'd like to be able to use osgi to affect the handlers result set

[osgi-dev] best pattern for instance factories

2012-12-19 Thread Raymond Auge
Hello All, I'd like to asked what is the suggested method for creating instance factories according to the service pattern. i.e. I would like to obtain a list of stateless instances which are single use and which are subsequently simply collected. I'm thinking service factory but I'm not sure

Re: [osgi-dev] best pattern for instance factories

2012-12-19 Thread Raymond Auge
Ok, I think what I may need is in fact a Handler registry service whereby bundles get the handler service and register any handler instances they have by event type. Later when an event requires processing, the handler service is called to locate handlers by type. This is pretty much the osgi

Re: [osgi-dev] best pattern for instance factories

2012-12-19 Thread BJ Hargrave
: Raymond Auge raymond.a...@liferay.com To: OSGi Developer Mail List osgi-dev@mail.osgi.org, Date: 2012/12/19 12:15 Subject:Re: [osgi-dev] best pattern for instance factories Sent by:osgi-dev-boun...@mail.osgi.org On Wed, Dec 19, 2012 at 11:27 AM, Felix Meschberger fmesc