1 package org
.argeo
.cms
.internal
.kernel
;
5 import org
.apache
.commons
.logging
.Log
;
6 import org
.apache
.commons
.logging
.LogFactory
;
7 import org
.argeo
.security
.SystemAuthentication
;
8 import org
.osgi
.framework
.BundleActivator
;
9 import org
.osgi
.framework
.BundleContext
;
12 * Activates the {@link Kernel} from the provided {@link BundleContext}. Gives
13 * access to kernel information for the rest of the bundle (and only it)
15 public class Activator
implements BundleActivator
{
16 private final Log log
= LogFactory
.getLog(Activator
.class);
18 private final static String systemKey
;
20 systemKey
= UUID
.randomUUID().toString();
21 System
.setProperty(SystemAuthentication
.SYSTEM_KEY_PROPERTY
, systemKey
);
24 private static BundleContext bundleContext
;
25 private Kernel kernel
;
28 public void start(BundleContext context
) throws Exception
{
29 assert bundleContext
== null;
30 assert kernel
== null;
31 bundleContext
= context
;
33 kernel
= new Kernel();
35 } catch (Exception e
) {
36 log
.error("Cannot boot kernel", e
);
41 public void stop(BundleContext context
) throws Exception
{
48 * Singleton interface to the {@link BundleContext} related to the calling
53 public static BundleContext
getBundleContext() {
58 * @return a String which is guaranteed to be unique between and constant
59 * within a Java static context (typically a VM launch)
62 public final static String
getSystemKey() {