package org.simantics.scl.reflection.internal;
+import java.util.concurrent.ForkJoinPool;
+
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+import org.simantics.scl.reflection.internal.registry.BindingRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class Activator implements BundleActivator {
+ private static final Logger LOGGER = LoggerFactory.getLogger(Activator.class);
private BundleContext context;
private static Activator instance;
public void start(BundleContext context) throws Exception {
this.context = context;
instance = this;
+
+ primeBindingRegistry();
+ }
+
+ private static void primeBindingRegistry() {
+ LOGGER.info("Priming BindingRegistry");
+ ForkJoinPool.commonPool().submit(() -> {
+ try {
+ // this forces static initialzation of the registry in advance
+ BindingRegistry.primeBindingRegistry();
+ } catch (Exception e) {
+ LOGGER.error("Could not prime binding registry", e);
+ }
+ LOGGER.info("Priming done");
+ });
}
@Override
}
public static void logError(String description, Exception e) {
- System.err.println(description);
+ LOGGER.error(description);
if(e != null)
e.printStackTrace();
Bundle bundle = getInstance().getContext().getBundle();