public class OSGiRuntimeContext extends DefaultRuntimeContext
Modifier and Type | Field and Description |
---|---|
protected org.osgi.framework.Bundle |
bundle |
protected org.osgi.framework.Bundle |
hostBundle |
protected String |
hostBundleId |
components, reader, runtime
Constructor and Description |
---|
OSGiRuntimeContext(org.osgi.framework.Bundle bundle) |
OSGiRuntimeContext(RuntimeService runtime,
org.osgi.framework.Bundle bundle) |
Modifier and Type | Method and Description |
---|---|
org.osgi.framework.Bundle |
getBundle()
Gets the container bundle or null if we are not running in an OSGi environment.
|
org.osgi.framework.Bundle |
getHostBundle() |
URL |
getLocalResource(String name)
Finds a local resource having the given name.
|
URL |
getResource(String name)
Finds a resource having the given name.
|
Class<?> |
loadClass(String className)
Loads the class given its name.
|
createRegistrationInfo, createRegistrationInfo, deploy, deploy, deploy, destroy, getComponents, getRuntime, isDeployed, isDeployed, isDeployed, setRuntime, undeploy, undeploy, undeploy
protected final org.osgi.framework.Bundle bundle
protected String hostBundleId
protected org.osgi.framework.Bundle hostBundle
public OSGiRuntimeContext(org.osgi.framework.Bundle bundle)
public OSGiRuntimeContext(RuntimeService runtime, org.osgi.framework.Bundle bundle)
public org.osgi.framework.Bundle getBundle()
RuntimeContext
getBundle
in interface RuntimeContext
getBundle
in class DefaultRuntimeContext
public URL getResource(String name)
RuntimeContext
getResource
in interface RuntimeContext
getResource
in class DefaultRuntimeContext
name
- the resource nameClassLoader.getResource(String)
public URL getLocalResource(String name)
RuntimeContext
Only the current bundle should be searched for the resource.
getLocalResource
in interface RuntimeContext
getLocalResource
in class DefaultRuntimeContext
name
- the local resource nameClassLoader.getResource(String)
public Class<?> loadClass(String className) throws ClassNotFoundException
RuntimeContext
loadClass
in interface RuntimeContext
loadClass
in class DefaultRuntimeContext
className
- the class nameClassNotFoundException
- if no such class were foundClassLoader.loadClass(String)
public org.osgi.framework.Bundle getHostBundle()
Copyright © 2018 Nuxeo. All rights reserved.