public class BundlesManager extends java.lang.Object implements org.eclipse.gemini.blueprint.context.BundleContextAware, FrameworkListener, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.eclipse.gemini.blueprint.context.event.OsgiBundleApplicationContextListener<org.eclipse.gemini.blueprint.context.event.OsgiBundleApplicationContextEvent>
BundleContext
Constructor and Description |
---|
BundlesManager() |
BundlesManager(BundleContext bundleContext) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected void |
checkTimeout(long begin,
java.lang.String msg) |
void |
destroy() |
OsgiBundle |
findFromPattern(java.lang.String pattern)
Find a single bundle based on a symbolic name pattern.
|
Bundle |
findRelatedBundle(OsgiBundle osgiBundle) |
OsgiBundle |
findRelatedBundle(java.lang.String moduleName,
java.lang.String moduleVersion) |
void |
frameworkEvent(FrameworkEvent event) |
OsgiBundle |
getBundle(java.lang.Long bundleId) |
BundleContext |
getBundleContext()
Use with caution since it may interfer with some cached information
within this object
|
<S> java.util.Collection<ServiceReference<S>> |
getServiceRefSynchronous(java.lang.Class<S> clss,
java.lang.String filter) |
<T> T |
getSingleService(java.lang.Class<T> clss,
java.lang.String filter,
java.lang.Boolean synchronous) |
<T> T |
getSingleServiceStrict(java.lang.Class<T> clss,
java.lang.String filter,
java.lang.Boolean synchronous) |
<S> ServiceTracker<S,S> |
newTracker(java.lang.Class<S> clss)
Creates and open a new service tracker.
|
void |
onOsgiApplicationEvent(org.eclipse.gemini.blueprint.context.event.OsgiBundleApplicationContextEvent event) |
protected void |
refreshSynchronous(Bundle bundle)
Refresh bundle synchronously.
|
void |
setBundleContext(BundleContext bundleContext) |
void |
setDefaultTimeout(java.lang.Long defaultTimeout) |
void |
setPollingPeriod(java.lang.Long pollingPeriod) |
protected void |
sleepWhenPolling() |
protected void |
startSynchronous(Bundle bundle)
Starts bundle synchronously.
|
protected void |
stopSynchronous(Bundle bundle)
Stops bundle synchronously.
|
protected void |
updateSynchronous(Bundle bundle)
Updates bundle synchronously.
|
void |
upgradeSynchronous(OsgiBundle osgiBundle)
Stop the module, update it, refresh it and restart it.
|
public BundlesManager()
public BundlesManager(BundleContext bundleContext)
public void upgradeSynchronous(OsgiBundle osgiBundle)
protected void updateSynchronous(Bundle bundle) throws BundleException
BundleException
protected void startSynchronous(Bundle bundle) throws BundleException
BundleException
protected void stopSynchronous(Bundle bundle) throws BundleException
BundleException
protected void refreshSynchronous(Bundle bundle) throws BundleException
BundleException
public void frameworkEvent(FrameworkEvent event)
frameworkEvent
in interface FrameworkListener
public <S> java.util.Collection<ServiceReference<S>> getServiceRefSynchronous(java.lang.Class<S> clss, java.lang.String filter) throws InvalidSyntaxException
InvalidSyntaxException
protected void checkTimeout(long begin, java.lang.String msg)
protected void sleepWhenPolling()
public <S> ServiceTracker<S,S> newTracker(java.lang.Class<S> clss)
public <T> T getSingleService(java.lang.Class<T> clss, java.lang.String filter, java.lang.Boolean synchronous)
public <T> T getSingleServiceStrict(java.lang.Class<T> clss, java.lang.String filter, java.lang.Boolean synchronous)
public OsgiBundle findRelatedBundle(java.lang.String moduleName, java.lang.String moduleVersion)
public Bundle findRelatedBundle(OsgiBundle osgiBundle)
osgiBundle
- cannot be nullSlcException
- if osgiBundle argument is nullpublic OsgiBundle findFromPattern(java.lang.String pattern)
public OsgiBundle getBundle(java.lang.Long bundleId)
public void setBundleContext(BundleContext bundleContext)
setBundleContext
in interface org.eclipse.gemini.blueprint.context.BundleContextAware
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
public void setDefaultTimeout(java.lang.Long defaultTimeout)
public BundleContext getBundleContext()
public void setPollingPeriod(java.lang.Long pollingPeriod)
public void onOsgiApplicationEvent(org.eclipse.gemini.blueprint.context.event.OsgiBundleApplicationContextEvent event)
onOsgiApplicationEvent
in interface org.eclipse.gemini.blueprint.context.event.OsgiBundleApplicationContextListener<org.eclipse.gemini.blueprint.context.event.OsgiBundleApplicationContextEvent>
Copyright © 2007–2020. All rights reserved.