I've used similar setups frequently. As another example, the Eclipse RCP framework
provides "ExtensionPoints." They're essentially an interface and a bit of
metadata used by the bundles. The core system provides the interfaces. Additional
plugins/bundles provide their own implementations of the extension point interface. Then,
the core system uses an ExtensionUtility to find all instances of the interface and acts
upon them. I'm not sure what the utility does under the hood, as far as a registry
pattern, etc. is concerned. I can look into it a bit.
Steve, I'll take a look at StrategySelector in the morning. Martin, if you're
interested, I'm willing to help prototype it with you.
-Brett-
----- Original Message -----
From: "Steve Ebersole" <steve(a)hibernate.org>
To: mailing(a)bibbernet.org
Cc: "Hibernate hibernate-dev" <hibernate-dev(a)lists.jboss.org>,
jpederse(a)redhat.com
Sent: Tuesday, August 28, 2012 5:14:12 PM
Subject: Re: [hibernate-dev] Concept of "service availability"
I am not familiar enough to know how this hooks in with OSGi.
StrategySelector is already pushed to master, if you want to incorporate
what this might look like using that I will certainly take a look.
On 08/28/2012 03:33 PM, mailing(a)bibbernet.org wrote:
I had a similar problem before:
In an osgi project we needed the ability to extend a main system with
functionality provided in addon bundles
We developed a main system which could be extended and complemented with
extenders of several kinds.
The main system provided (exported) a tree of marker interfaces like
public interface ExtenderMarker {};
public interface TypeAExtender extends ExtenderMarker
public interface TypeBExtender extends ExtenderMarker
....
and had a "helper" which scans services, tracks services and initially
scans the framework for interesting services (started from the bundle
activator of the main system).
The extender bundles only implemented the extenders and registered OSGI
services with the ExtenderMarker interface and maybe also the concrete
interface. They had no more tasks to do.
Now the main system could "use" the extenders which got registered by
the "helper" and the "helper" was handling the live cycle events,
etc.
Simple approach based on the whiteboard pattern.
- Martin
--
steve(a)hibernate.org
http://hibernate.org
_______________________________________________
hibernate-dev mailing list
hibernate-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev