Package org.nuxeo.osgi
Class OSGiAdapter
- java.lang.Object
-
- org.nuxeo.osgi.OSGiAdapter
-
- Direct Known Subclasses:
StandaloneApplication
public class OSGiAdapter extends Object
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected BundleIdGeneratorbundleIdsprotected ListenerListbundleListenersprotected FiledataDirprotected ListenerListframeworkListenersprotected FileidTableFileprotected Propertiespropertiesprotected BundleRegistryregistryprotected ListenerListserviceListenersprotected Map<String,org.osgi.framework.ServiceRegistration>servicesprotected SystemBundlesystemBundleprotected FileworkingDir
-
Constructor Summary
Constructors Constructor Description OSGiAdapter(File workingDir)OSGiAdapter(File workingDir, File dataDir, Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBundleListener(org.osgi.framework.BundleListener listener)voidaddFrameworkListener(org.osgi.framework.FrameworkListener listener)voidaddServiceListener(org.osgi.framework.ServiceListener listener)voidaddServiceListener(org.osgi.framework.ServiceListener listener, String filter)voidfireBundleEvent(org.osgi.framework.BundleEvent event)voidfireFrameworkEvent(org.osgi.framework.FrameworkEvent event)voidfireServiceEvent(org.osgi.framework.ServiceEvent event)BundleImplgetBundle(String symbolicName)longgetBundleId(String symbolicName)FilegetDataDir()BundleImpl[]getInstalledBundles()StringgetProperty(String key)StringgetProperty(String key, String defvalue)BundleRegistrygetRegistry()org.osgi.framework.BundlegetSystemBundle()FilegetWorkingDir()protected voidinitialize(Properties properties)voidinstall(BundleImpl bundle)voidremoveBundleListener(org.osgi.framework.BundleListener listener)voidremoveFrameworkListener(org.osgi.framework.FrameworkListener listener)voidremoveService(String clazz)voidremoveServiceListener(org.osgi.framework.ServiceListener listener)voidsetProperty(String name, String value)voidsetSystemBundle(SystemBundle systemBundle)voidshutdown()voiduninstall(BundleImpl bundle)
-
-
-
Field Detail
-
workingDir
protected final File workingDir
-
dataDir
protected final File dataDir
-
idTableFile
protected File idTableFile
-
bundleIds
protected BundleIdGenerator bundleIds
-
frameworkListeners
protected ListenerList frameworkListeners
-
bundleListeners
protected ListenerList bundleListeners
-
serviceListeners
protected ListenerList serviceListeners
-
registry
protected BundleRegistry registry
-
properties
protected Properties properties
-
systemBundle
protected SystemBundle systemBundle
-
-
Constructor Detail
-
OSGiAdapter
public OSGiAdapter(File workingDir)
-
OSGiAdapter
public OSGiAdapter(File workingDir, File dataDir, Properties properties)
-
-
Method Detail
-
removeService
public void removeService(String clazz)
-
initialize
protected void initialize(Properties properties)
-
setSystemBundle
public void setSystemBundle(SystemBundle systemBundle) throws org.osgi.framework.BundleException
- Throws:
org.osgi.framework.BundleException
-
getRegistry
public BundleRegistry getRegistry()
-
setProperty
public void setProperty(String name, String value)
- Parameters:
name- the property name.value- the property value.
-
shutdown
public void shutdown() throws IOException- Throws:
IOException
-
getBundleId
public long getBundleId(String symbolicName)
-
getWorkingDir
public File getWorkingDir()
-
getDataDir
public File getDataDir()
-
getBundle
public BundleImpl getBundle(String symbolicName)
-
getInstalledBundles
public BundleImpl[] getInstalledBundles()
-
install
public void install(BundleImpl bundle) throws org.osgi.framework.BundleException
- Throws:
org.osgi.framework.BundleException
-
uninstall
public void uninstall(BundleImpl bundle) throws org.osgi.framework.BundleException
- Throws:
org.osgi.framework.BundleException
-
addFrameworkListener
public void addFrameworkListener(org.osgi.framework.FrameworkListener listener)
-
removeFrameworkListener
public void removeFrameworkListener(org.osgi.framework.FrameworkListener listener)
-
addServiceListener
public void addServiceListener(org.osgi.framework.ServiceListener listener)
-
addServiceListener
public void addServiceListener(org.osgi.framework.ServiceListener listener, String filter)
-
removeServiceListener
public void removeServiceListener(org.osgi.framework.ServiceListener listener)
-
addBundleListener
public void addBundleListener(org.osgi.framework.BundleListener listener)
-
removeBundleListener
public void removeBundleListener(org.osgi.framework.BundleListener listener)
-
fireFrameworkEvent
public void fireFrameworkEvent(org.osgi.framework.FrameworkEvent event)
-
fireServiceEvent
public void fireServiceEvent(org.osgi.framework.ServiceEvent event)
-
fireBundleEvent
public void fireBundleEvent(org.osgi.framework.BundleEvent event)
-
getSystemBundle
public org.osgi.framework.Bundle getSystemBundle()
-
-