Package org.apache.unomi.lifecycle
Class BundleWatcherImpl
- java.lang.Object
-
- org.apache.unomi.lifecycle.BundleWatcherImpl
-
- All Implemented Interfaces:
EventListener
,BundleWatcher
,org.osgi.framework.BundleListener
,org.osgi.framework.ServiceListener
,org.osgi.framework.SynchronousBundleListener
public class BundleWatcherImpl extends Object implements org.osgi.framework.SynchronousBundleListener, org.osgi.framework.ServiceListener, BundleWatcher
This class listens to the global Apache Unomi bundle lifecycle, to provide statistics and state of the overall system. It notably displays messages for successfull or unsuccessfull startups as well as startup times.
-
-
Constructor Summary
Constructors Constructor Description BundleWatcherImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allAdditionalBundleStarted()
void
bundleChanged(org.osgi.framework.BundleEvent event)
void
checkExistingBundles()
void
destroy()
ServerInfo
getBundleServerInfo(org.osgi.framework.Bundle bundle)
List<ServerInfo>
getServerInfos()
Retrieves the list of the server information objects, that include extensions.void
init()
boolean
isStartupComplete()
void
serviceChanged(org.osgi.framework.ServiceEvent event)
void
setBundleContext(org.osgi.framework.BundleContext bundleContext)
void
setCheckStartupStateRefreshInterval(Integer checkStartupStateRefreshInterval)
void
setFeaturesService(org.apache.karaf.features.FeaturesService featuresService)
void
setRequiredBundles(Map<String,Boolean> requiredBundles)
void
setRequiredServices(String requiredServices)
boolean
shouldInstallAdditionalFeatures()
-
-
-
Method Detail
-
setCheckStartupStateRefreshInterval
public void setCheckStartupStateRefreshInterval(Integer checkStartupStateRefreshInterval)
-
setRequiredServices
public void setRequiredServices(String requiredServices)
-
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
-
setFeaturesService
public void setFeaturesService(org.apache.karaf.features.FeaturesService featuresService)
-
init
public void init()
-
getServerInfos
public List<ServerInfo> getServerInfos()
Description copied from interface:BundleWatcher
Retrieves the list of the server information objects, that include extensions. Each object includes the name and version of the server, build time information and the event types if recognizes as well as the capabilities supported by the system.- Specified by:
getServerInfos
in interfaceBundleWatcher
- Returns:
- a list of ServerInfo objects with all the server information
-
allAdditionalBundleStarted
public boolean allAdditionalBundleStarted()
- Specified by:
allAdditionalBundleStarted
in interfaceBundleWatcher
-
destroy
public void destroy()
-
checkExistingBundles
public void checkExistingBundles()
-
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event)
- Specified by:
bundleChanged
in interfaceorg.osgi.framework.BundleListener
-
serviceChanged
public void serviceChanged(org.osgi.framework.ServiceEvent event)
- Specified by:
serviceChanged
in interfaceorg.osgi.framework.ServiceListener
-
shouldInstallAdditionalFeatures
public boolean shouldInstallAdditionalFeatures()
-
isStartupComplete
public boolean isStartupComplete()
- Specified by:
isStartupComplete
in interfaceBundleWatcher
-
getBundleServerInfo
public ServerInfo getBundleServerInfo(org.osgi.framework.Bundle bundle)
-
-