Package org.nuxeo.runtime.osgi
Class OSGiRuntimeContext
java.lang.Object
org.nuxeo.runtime.model.impl.DefaultRuntimeContext
org.nuxeo.runtime.osgi.OSGiRuntimeContext
- All Implemented Interfaces:
RuntimeContext
- Author:
- Bogdan Stefanescu
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.osgi.framework.Bundle
protected org.osgi.framework.Bundle
protected String
Fields inherited from class org.nuxeo.runtime.model.impl.DefaultRuntimeContext
components, reader, runtime
-
Constructor Summary
ConstructorDescriptionOSGiRuntimeContext
(RuntimeService runtime, org.osgi.framework.Bundle bundle) OSGiRuntimeContext
(org.osgi.framework.Bundle bundle) -
Method Summary
Modifier and TypeMethodDescriptionorg.osgi.framework.Bundle
Gets the container bundle or null if we are not running in an OSGi environment.org.osgi.framework.Bundle
getLocalResource
(String name) Finds a local resource having the given name.getResource
(String name) Finds a resource having the given name.Class<?>
Loads the class given its name.Methods inherited from class org.nuxeo.runtime.model.impl.DefaultRuntimeContext
createRegistrationInfo, createRegistrationInfo, deploy, deploy, deploy, destroy, getComponentFromSourceId, getComponents, getRuntime, isDeployed, isDeployed, isDeployed, setRuntime, undeploy, undeploy, undeploy
-
Field Details
-
bundle
protected final org.osgi.framework.Bundle bundle -
hostBundleId
-
hostBundle
protected org.osgi.framework.Bundle hostBundle
-
-
Constructor Details
-
OSGiRuntimeContext
public OSGiRuntimeContext(org.osgi.framework.Bundle bundle) -
OSGiRuntimeContext
-
-
Method Details
-
getBundle
public org.osgi.framework.Bundle getBundle()Description copied from interface:RuntimeContext
Gets the container bundle or null if we are not running in an OSGi environment.- Specified by:
getBundle
in interfaceRuntimeContext
- Overrides:
getBundle
in classDefaultRuntimeContext
-
getResource
Description copied from interface:RuntimeContext
Finds a resource having the given name.- Specified by:
getResource
in interfaceRuntimeContext
- Overrides:
getResource
in classDefaultRuntimeContext
- Parameters:
name
- the resource name- Returns:
- an URL to the resource having that name or null if not was found
- See Also:
-
getLocalResource
Description copied from interface:RuntimeContext
Finds a local resource having the given name.Only the current bundle should be searched for the resource.
- Specified by:
getLocalResource
in interfaceRuntimeContext
- Overrides:
getLocalResource
in classDefaultRuntimeContext
- Parameters:
name
- the local resource name- Returns:
- an URL to the resource having that name or null if not was found
- See Also:
-
loadClass
Description copied from interface:RuntimeContext
Loads the class given its name.- Specified by:
loadClass
in interfaceRuntimeContext
- Overrides:
loadClass
in classDefaultRuntimeContext
- Parameters:
className
- the class name- Returns:
- the class object
- Throws:
ClassNotFoundException
- if no such class were found- See Also:
-
getHostBundle
public org.osgi.framework.Bundle getHostBundle()
-