Package org.nuxeo.runtime.osgi
Class OSGiRuntimeActivator
- java.lang.Object
-
- org.nuxeo.runtime.osgi.OSGiRuntimeActivator
-
- All Implemented Interfaces:
org.osgi.framework.BundleActivator
- Direct Known Subclasses:
OSGIRuntimeTestActivator
public class OSGiRuntimeActivator extends Object implements org.osgi.framework.BundleActivator
The default BundleActivator for NXRuntime over an OSGi comp. platform.- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected OSGiComponentLoader
componentLoader
protected org.osgi.framework.BundleContext
context
protected org.osgi.framework.ServiceReference
pkgAdmin
protected OSGiRuntimeService
runtime
-
Constructor Summary
Constructors Constructor Description OSGiRuntimeActivator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.osgi.framework.Bundle
getBundle(String name)
static OSGiRuntimeActivator
getInstance()
protected void
initialize(AbstractRuntimeService runtime)
Gives a chance to derived classes to initialize them before the runtime is started.Class<?>
loadClass(String ref)
Load a class from another bundle given its reference asbundleSymbolicName:className
If nobundleSymbolicName:
prefix is given then a classForName will be doneClass<?>
loadClass(String bundleName, String className)
Object
newInstance(String ref)
Object
newInstance(String bundleName, String className)
void
start(org.osgi.framework.BundleContext context)
void
stop(org.osgi.framework.BundleContext context)
protected void
uninitialize(AbstractRuntimeService runtime)
Gives a chance to derived classes to uninitialize them after the runtime is stopped.
-
-
-
Field Detail
-
runtime
protected OSGiRuntimeService runtime
-
componentLoader
protected OSGiComponentLoader componentLoader
-
pkgAdmin
protected org.osgi.framework.ServiceReference pkgAdmin
-
context
protected org.osgi.framework.BundleContext context
-
-
Method Detail
-
getInstance
public static OSGiRuntimeActivator getInstance()
-
start
public void start(org.osgi.framework.BundleContext context)
- Specified by:
start
in interfaceorg.osgi.framework.BundleActivator
-
stop
public void stop(org.osgi.framework.BundleContext context)
- Specified by:
stop
in interfaceorg.osgi.framework.BundleActivator
-
getBundle
public org.osgi.framework.Bundle getBundle(String name)
-
loadClass
public Class<?> loadClass(String ref) throws ReflectiveOperationException
Load a class from another bundle given its reference asbundleSymbolicName:className
If nobundleSymbolicName:
prefix is given then a classForName will be done- Throws:
ReflectiveOperationException
-
loadClass
public Class<?> loadClass(String bundleName, String className) throws ReflectiveOperationException
- Throws:
ReflectiveOperationException
-
newInstance
public Object newInstance(String ref) throws ReflectiveOperationException
- Throws:
ReflectiveOperationException
-
newInstance
public Object newInstance(String bundleName, String className) throws ReflectiveOperationException
- Throws:
ReflectiveOperationException
-
initialize
protected void initialize(AbstractRuntimeService runtime)
Gives a chance to derived classes to initialize them before the runtime is started.- Parameters:
runtime
- the current runtime
-
uninitialize
protected void uninitialize(AbstractRuntimeService runtime)
Gives a chance to derived classes to uninitialize them after the runtime is stopped.- Parameters:
runtime
- the current runtime
-
-