Github user neykov commented on the pull request:
https://github.com/apache/brooklyn-server/pull/65#issuecomment-198474444
Just came by how jclouds approaches the same problem. Here it is just FYI.
In an activator they subscribe to bundle add/remove events. When a bundle
is added they scan it for
`/META-INF/services/org.jclouds.providers.ProviderMetadata`, instantiating the
classes inside using the bundle class loader. Discovered instances are recorded
and fetched when needed.
See
[`MetadataBundleListener`](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/osgi/MetadataBundleListener.java)
and
[`ProviderRegistry`](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/osgi/ProviderRegistry.java)
for further details.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---