second commit of adding a bundle tracker (missed some files before)

This commit is contained in:
fmittag committed 2012-06-19 11:00:29 +02:00
1 parent a427a06d5c
commit 1fd23701f4
4 files changed
+13 -16

No files matched your search

@@ -38,3 +38,4 @@ Web-ContextPath: /gwt
Bundle-ClassPath: WEB-INF/classes/,
WEB-INF/lib/gwt-maps.jar,
WEB-INF/lib/gwt-servlet.jar
TrackLifecycle: true
@@ -1,14 +0,0 @@
package com.sap.sailing.server.admin;
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
public class ServerCommandProvider implements CommandProvider {
public void _hello(CommandInterpreter ci) {
ci.print("Hello, " + ci.nextArgument());
}
public String getHelp() {
return "\thello - say hello\n";
}
}
@@ -11,8 +11,8 @@ import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.common.impl.Util.Triple;
import com.sap.sailing.server.RacingEventService;
@@ -20,6 +20,8 @@ public class Activator implements BundleActivator, ServiceListener {
private static final Logger logger = Logger.getLogger(Activator.class.getName());
private static BundleContext fContext;
private static ExtenderBundleTracker extenderBundleTracker;
public static BundleContext getDefault() {
return fContext;
@@ -27,6 +29,9 @@ public class Activator implements BundleActivator, ServiceListener {
public void start(BundleContext context) throws Exception {
fContext = context;
extenderBundleTracker = new ExtenderBundleTracker(context);
extenderBundleTracker.open();
RacingEventService service = new RacingEventServiceImpl();
// register the racing service
@@ -38,6 +43,11 @@ public class Activator implements BundleActivator, ServiceListener {
public void stop(BundleContext context) throws Exception {
fContext = null;
if(extenderBundleTracker != null) {
extenderBundleTracker.open();
}
ServiceTracker<RacingEventService, RacingEventService> racingEventServiceTracker = new ServiceTracker<RacingEventService, RacingEventService>(context, RacingEventService.class.getName(), null);
racingEventServiceTracker.open();
@@ -1,4 +1,4 @@
package com.sap.sailing.server.admin;
package com.sap.sailing.server.impl;
import java.util.logging.Logger;