X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Finternal%2Fkernel%2FActivator.java;h=1d40c99463c07e58a35ae59b1b900040acc5f7fb;hb=fc5ccf2c8877e6253bdbebd071b8a6555daf64ec;hp=6bad825ddda3a629b324c4d15b73936a369c5f8f;hpb=35904a4a72fe8a4908c345f73856711c7b4c472c;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/internal/kernel/Activator.java b/org.argeo.cms/src/org/argeo/cms/internal/kernel/Activator.java index 6bad825dd..1d40c9946 100644 --- a/org.argeo.cms/src/org/argeo/cms/internal/kernel/Activator.java +++ b/org.argeo.cms/src/org/argeo/cms/internal/kernel/Activator.java @@ -2,7 +2,8 @@ package org.argeo.cms.internal.kernel; import java.util.UUID; -import org.argeo.security.SystemAuthentication; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; @@ -11,22 +12,29 @@ import org.osgi.framework.BundleContext; * access to kernel information for the rest of the bundle (and only it) */ public class Activator implements BundleActivator { + public final static String SYSTEM_KEY_PROPERTY = "argeo.security.systemKey"; + private final Log log = LogFactory.getLog(Activator.class); + private final static String systemKey; static { systemKey = UUID.randomUUID().toString(); - System.setProperty(SystemAuthentication.SYSTEM_KEY_PROPERTY, systemKey); + System.setProperty(SYSTEM_KEY_PROPERTY, systemKey); } private static BundleContext bundleContext; - private Kernel kernel; + private static Kernel kernel; @Override public void start(BundleContext context) throws Exception { assert bundleContext == null; assert kernel == null; bundleContext = context; - kernel = new Kernel(); - kernel.init(); + try { + kernel = new Kernel(); + kernel.init(); + } catch (Exception e) { + log.error("Cannot boot kernel", e); + } } @Override @@ -46,6 +54,10 @@ public class Activator implements BundleActivator { return bundleContext; } + public static KernelHeader getKernelHeader() { + return kernel; + } + /** * @return a String which is guaranteed to be unique between and constant * within a Java static context (typically a VM launch)