mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-01 00:30:46 +00:00
added ping mark functionality to adminConsole
This commit is contained in:
1 parent
335e090ebc
commit
9cffd20913
53 files changed
+440
-109
No files matched your search
@@ -1,15 +1,26 @@
|
||||
package com.sap.sailing.server.impl;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Dictionary;
|
||||
import java.util.HashSet;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceRegistration;
|
||||
|
||||
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.domain.common.racelog.tracking.TypeBasedServiceFinder;
|
||||
import com.sap.sailing.domain.persistence.racelog.tracking.GPSFixMongoHandler;
|
||||
import com.sap.sailing.domain.persistence.racelog.tracking.impl.GPSFixMongoHandlerImpl;
|
||||
import com.sap.sailing.domain.persistence.racelog.tracking.impl.GPSFixMovingMongoHandlerImpl;
|
||||
import com.sap.sailing.domain.tracking.impl.GPSFixImpl;
|
||||
import com.sap.sailing.domain.tracking.impl.GPSFixMovingImpl;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sailing.server.racelog.tracking.CachedOsgiTypeBasedServiceFinderFactory;
|
||||
|
||||
@@ -25,6 +36,8 @@ public class Activator implements BundleActivator {
|
||||
private RacingEventServiceImpl racingEventService;
|
||||
|
||||
private final boolean clearPersistentCompetitors;
|
||||
|
||||
private Set<ServiceRegistration<?>> registrations = new HashSet<>();
|
||||
|
||||
public Activator() {
|
||||
clearPersistentCompetitors = Boolean.valueOf(System.getProperty(CLEAR_PERSISTENT_COMPETITORS_PROPERTY_NAME, ""+true));
|
||||
@@ -47,6 +60,16 @@ public class Activator implements BundleActivator {
|
||||
// register the racing service in the OSGi registry
|
||||
racingEventService.setBundleContext(context);
|
||||
context.registerService(RacingEventService.class.getName(), racingEventService, null);
|
||||
|
||||
Dictionary<String, String> properties = new Hashtable<String, String>();
|
||||
properties.put(TypeBasedServiceFinder.TYPE, GPSFixImpl.class.getName());
|
||||
registrations.add(context.registerService(GPSFixMongoHandler.class,
|
||||
new GPSFixMongoHandlerImpl(racingEventService.getMongoObjectFactory(),
|
||||
racingEventService.getDomainObjectFactory()), properties));
|
||||
properties.put(TypeBasedServiceFinder.TYPE, GPSFixMovingImpl.class.getName());
|
||||
registrations.add(context.registerService(GPSFixMongoHandler.class,
|
||||
new GPSFixMovingMongoHandlerImpl(racingEventService.getMongoObjectFactory(),
|
||||
racingEventService.getDomainObjectFactory()), properties));
|
||||
|
||||
logger.log(Level.INFO, "Started "+context.getBundle().getSymbolicName()+". Character encoding: "+
|
||||
Charset.defaultCharset());
|
||||
@@ -66,5 +89,9 @@ public class Activator implements BundleActivator {
|
||||
for (Regatta regatta : racingEventService.getAllRegattas()) {
|
||||
racingEventService.stopTracking(regatta);
|
||||
}
|
||||
for (ServiceRegistration<?> reg : registrations) {
|
||||
reg.unregister();
|
||||
}
|
||||
registrations.clear();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user