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