|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jclouds.osgi.MetadataBundleListener
public class MetadataBundleListener
A BundleListener that listens for BundleEvent and searches for ProviderMetadata and ApiMetadata in newly
installed Bundles. This is used as a workaround for OSGi environments where the ServiceLoader cannot cross bundle
boundaries.
| Constructor Summary | |
|---|---|
MetadataBundleListener()
|
|
| Method Summary | |
|---|---|
void |
addApiListenerListener(ApiListener listener)
Adds a ApiListener and notifies it of existing ApiMetadata. |
void |
addProviderListener(ProviderListener listener)
Adds a ProviderListener and notifies it of existing ProviderMetadata. |
void |
bundleChanged(org.osgi.framework.BundleEvent event)
|
Iterable<ApiMetadata> |
listApiMetadata(org.osgi.framework.Bundle bundle)
Creates an instance of ApiMetadata from the Bundle. |
Iterable<ProviderMetadata> |
listProviderMetadata(org.osgi.framework.Bundle bundle)
Creates an instance of ProviderMetadata from the Bundle. |
void |
removeApiListenerListener(ApiListener listener)
Removes the ApiListener |
void |
removeProviderListener(ProviderListener listener)
Removes the ProviderListener |
void |
start(org.osgi.framework.BundleContext bundleContext)
Starts the listener. |
void |
stop(org.osgi.framework.BundleContext bundleContext)
Stops the listener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MetadataBundleListener()
| Method Detail |
|---|
public void start(org.osgi.framework.BundleContext bundleContext)
ProviderMetadata and ApiMetadata found.
Registers the itself as a BundleListener.
bundleContext - public void stop(org.osgi.framework.BundleContext bundleContext)
BundleListeners.
Clears metadata maps and listeners lists.
bundleContext - public void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged in interface org.osgi.framework.BundleListenerpublic Iterable<ProviderMetadata> listProviderMetadata(org.osgi.framework.Bundle bundle)
ProviderMetadata from the Bundle.
bundle -
public Iterable<ApiMetadata> listApiMetadata(org.osgi.framework.Bundle bundle)
ApiMetadata from the Bundle.
bundle -
public void addProviderListener(ProviderListener listener)
ProviderListener and notifies it of existing ProviderMetadata.
listener - The listener.public void removeProviderListener(ProviderListener listener)
ProviderListener
listener - The listenerpublic void addApiListenerListener(ApiListener listener)
ApiListener and notifies it of existing ApiMetadata.
listener - public void removeApiListenerListener(ApiListener listener)
ApiListener
listener -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||