2016/05/28 - Apache Tuscany has been retired.
For more information, please explore the Attic.
org.apache.tuscany.sca.osgi.runtime
Class OSGiRuntime
java.lang.Object
org.apache.tuscany.sca.osgi.runtime.OSGiRuntime
- Direct Known Subclasses:
- EquinoxRuntime, FelixRuntime, KnopflerfishRuntime
public abstract class OSGiRuntime
- extends java.lang.Object
Base OSGiRuntime implementation.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OSGiRuntime
public OSGiRuntime()
getBundleContext
public abstract BundleContext getBundleContext()
supportsBundleFragments
public abstract boolean supportsBundleFragments()
startRuntime
protected abstract BundleContext startRuntime(boolean tuscanyRunningInOSGiContainer)
throws java.lang.Exception
- Throws:
java.lang.Exception
findRuntime
public static OSGiRuntime findRuntime()
throws java.lang.Exception
- System property org.apache.tuscany.implementation.osgi.runtime.OSGiRuntime can be set to the
name of the OSGiRuntime class (eg. EquinoxRuntime). If set, start this runtime and return the
system bundlecontext. If not set, start Equinox/Felix/Knopflerfish (in that order) from the
classpath.
- Throws:
BundleException
java.lang.Exception
getRuntime
public static OSGiRuntime getRuntime()
throws java.lang.Exception
- Throws:
java.lang.Exception
getRuntime
public static OSGiRuntime getRuntime(boolean tuscanyRunningInOSGiContainer)
throws java.lang.Exception
- Throws:
java.lang.Exception
shutdown
public void shutdown()
throws java.lang.Exception
- Throws:
java.lang.Exception
setBundleContext
protected void setBundleContext(BundleContext bundleContext)
getContextClassLoader
public java.lang.ClassLoader getContextClassLoader()
setContextClassLoader
protected void setContextClassLoader(java.lang.ClassLoader contextClassLoader)
initialize
protected void initialize()
findBundle
public Bundle findBundle(java.lang.String bundleSymbolicName,
java.lang.String bundleVersion)
findInstalledBundle
public static Bundle findInstalledBundle(java.lang.String bundleLocation)
findInstalledBundle
public static Bundle findInstalledBundle(java.net.URL bundleURL)
findBundle
public Bundle findBundle(java.lang.String bundleLocation)
installBundle
public Bundle installBundle(java.lang.String bundleLocation,
java.io.InputStream inputStream)
stop
public static void stop()
throws java.lang.Exception
- Stops the OSGi instance.
- Throws:
java.lang.Exception
- Failed to shutdown the OSGi instance.