X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.slc.autoui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fautoui%2FAutoUiActivator.java;h=01b2492534451be9cb9891445ddde22d819716bf;hb=86fd4dd51b94ae4883e6c89c0d575be93ffd1983;hp=463a10bf3e0441fde886b3fdde6752fd5b179003;hpb=dcc76cf4d064a6975b30212191243be5f3b50633;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/AutoUiActivator.java b/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/AutoUiActivator.java index 463a10bf3..01b249253 100644 --- a/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/AutoUiActivator.java +++ b/org.argeo.slc.autoui/src/main/java/org/argeo/slc/autoui/AutoUiActivator.java @@ -2,27 +2,31 @@ package org.argeo.slc.autoui; import java.util.Properties; -import org.argeo.slc.autoui.internal.AutoUiApplicationJemmy; -import org.osgi.framework.BundleActivator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.argeo.slc.autoui.internal.DetachedExecutionServerImpl; import org.osgi.framework.BundleContext; -public class AutoUiActivator implements BundleActivator { +public class AutoUiActivator extends AbstractDetachedActivator { + private final Log log = LogFactory.getLog(getClass()); - public void start(BundleContext context) throws Exception { - stdOut("AutoUi started"); - Properties properties = new Properties(); - AutoUiApplicationJemmy applicationJemmy = new AutoUiApplicationJemmy(); - context.registerService(AutoUiApplication.class.getName(), - applicationJemmy, properties); - context.registerService(Runnable.class.getName(), applicationJemmy, - properties); - } + private DetachedExecutionServerImpl executionServer; + + public void startAutoBundle(BundleContext context) throws Exception { + Object obj = getStaticRefProvider().getStaticRef("executionServer"); + if (obj != null) + executionServer = (DetachedExecutionServerImpl) obj; + else + throw new DetachedException("Could not find execution server."); + + executionServer.init(context); - public void stop(BundleContext context) throws Exception { - stdOut("AutoUi stopped"); + context.registerService(DetachedExecutionServer.class.getName(), + executionServer, new Properties()); + log.info("AutoUi started"); } - public static void stdOut(Object obj) { - System.out.println(obj); + public void stopAutoBundle(BundleContext context) throws Exception { + log.info("AutoUi stopped"); } }