]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.init/src/org/argeo/init/osgi/Activator.java
Remove unused configurations in build.properties
[lgpl/argeo-commons.git] / org.argeo.init / src / org / argeo / init / osgi / Activator.java
1 package org.argeo.init.osgi;
2
3 import java.lang.System.Logger;
4 import java.lang.System.Logger.Level;
5 import java.util.Objects;
6
7 import org.argeo.init.logging.ThinLoggerFinder;
8 import org.osgi.framework.BundleActivator;
9 import org.osgi.framework.BundleContext;
10
11 /**
12 * An OSGi configurator. See
13 * <a href="http://wiki.eclipse.org/Configurator">http:
14 * //wiki.eclipse.org/Configurator</a>
15 */
16 public class Activator implements BundleActivator {
17 static {
18 // must be called first
19 ThinLoggerFinder.lazyInit();
20 }
21 private Logger logger = System.getLogger(Activator.class.getName());
22
23 private Long checkpoint = null;
24 private OsgiRuntimeContext runtimeContext;
25
26 public void start(final BundleContext bundleContext) throws Exception {
27 if (runtimeContext == null) {
28 runtimeContext = new OsgiRuntimeContext(bundleContext);
29 }
30 logger.log(Level.DEBUG, () -> "Argeo init via OSGi activator");
31
32 // admin thread
33 // Thread adminThread = new AdminThread(bundleContext);
34 // adminThread.start();
35
36 // bootstrap
37 // OsgiBoot osgiBoot = new OsgiBoot(bundleContext);
38 if (checkpoint == null) {
39 // osgiBoot.bootstrap();
40 checkpoint = System.currentTimeMillis();
41 } else {
42 runtimeContext.update();
43 checkpoint = System.currentTimeMillis();
44 }
45 }
46
47 public void stop(BundleContext context) throws Exception {
48 Objects.requireNonNull(runtimeContext);
49 runtimeContext.stop(context);
50 }
51 }