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 OSGiComponentLoadercomponentLoaderprotected org.osgi.framework.BundleContextcontextprotected org.osgi.framework.ServiceReferencepkgAdminprotected OSGiRuntimeServiceruntime
-
Constructor Summary
Constructors Constructor Description OSGiRuntimeActivator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.osgi.framework.BundlegetBundle(String name)static OSGiRuntimeActivatorgetInstance()protected voidinitialize(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:classNameIf nobundleSymbolicName:prefix is given then a classForName will be doneClass<?>loadClass(String bundleName, String className)ObjectnewInstance(String ref)ObjectnewInstance(String bundleName, String className)voidstart(org.osgi.framework.BundleContext context)voidstop(org.osgi.framework.BundleContext context)protected voiduninitialize(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:
startin interfaceorg.osgi.framework.BundleActivator
-
stop
public void stop(org.osgi.framework.BundleContext context)
- Specified by:
stopin 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:classNameIf 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
-
-