private final BundleContext bundleContext = Activator.getBundleContext();
- private JackrabbitNode node;
- private OsgiJackrabbitRepositoryFactory repositoryFactory;
- private NodeSecurity nodeSecurity;
- private NodeHttp nodeHttp;
+ ThreadGroup threadGroup = new ThreadGroup(Kernel.class.getSimpleName());
+ JackrabbitNode node;
+ OsgiJackrabbitRepositoryFactory repositoryFactory;
+ NodeSecurity nodeSecurity;
+ NodeHttp nodeHttp;
+ private KernelThread kernelThread;
void init() {
ClassLoader currentContextCl = Thread.currentThread()
ExtendedHttpService httpService = waitForHttpService();
nodeHttp = new NodeHttp(httpService, node, nodeSecurity);
+ // Kernel thread
+ kernelThread = new KernelThread(this);
+ kernelThread.setContextClassLoader(Kernel.class.getClassLoader());
+ kernelThread.start();
+
// Publish services to OSGi
nodeSecurity.publish();
node.publish(repositoryFactory);
void destroy() {
long begin = System.currentTimeMillis();
+ kernelThread.destroyAndJoin();
+
if (nodeHttp != null)
nodeHttp.destroy();
if (nodeSecurity != null)