mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-28 14:57:12 +00:00
fixed launch config for GWT; fixed threading for TrackedRaceImpl
This commit is contained in:
1 parent
4ecc03cba2
commit
f97b20613d
3 files changed
+19
-13
No files matched your search
+14
-8
@@ -9,6 +9,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.NavigableSet;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.sap.sailing.domain.base.Bearing;
|
||||
@@ -104,6 +106,8 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
||||
|
||||
private final long millisecondsOverWhichToAverageSpeed;
|
||||
|
||||
private static final Executor executor = Executors.newSingleThreadExecutor();
|
||||
|
||||
public TrackedRaceImpl(TrackedEvent trackedEvent, RaceDefinition race, WindStore windStore,
|
||||
long millisecondsOverWhichToAverageWind, long millisecondsOverWhichToAverageSpeed) {
|
||||
super();
|
||||
@@ -141,6 +145,10 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
||||
competitorRankings = new HashMap<TimePoint, List<Competitor>>();
|
||||
}
|
||||
|
||||
private Executor getExecutor() {
|
||||
return executor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Precondition: race has already been set, e.g., in constructor before this methocd is called
|
||||
*/
|
||||
@@ -430,15 +438,14 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
||||
// the track's listeners about the receipt of a new GPS fix which leads to the
|
||||
// invalidation of the TrackBasedEstimationWindTrackImpl's cache which requests
|
||||
// the TrackBasedEstimationWindTrackImpl's monitor. --> deadlock
|
||||
new Thread("Adding cache invalidation listener for start/first-mark direction for "+getRace().getName()) {
|
||||
getExecutor().execute(new Runnable() {
|
||||
public void run() {
|
||||
synchronized (directionFromStartToNextMarkCacheLock) {
|
||||
// FIXME don't we have to expect that after cache invalidation the listeners are still subscribed?
|
||||
addDirectionFromStartToNextMarkCacheInvalidationListener();
|
||||
directionFromStartToNextMarkCache = finalResult;
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
});
|
||||
} else {
|
||||
result = null;
|
||||
}
|
||||
@@ -891,27 +898,26 @@ public abstract class TrackedRaceImpl implements TrackedRace, CourseListener {
|
||||
|
||||
@Override
|
||||
public void gpsFixReceived(GPSFix fix, Buoy buoy) {
|
||||
new Thread("StartToNextMarkCacheInvalidationListener.gpsFixReceived for buoy " + buoy.getName()) {
|
||||
getExecutor().execute(new Runnable() {
|
||||
public void run() {
|
||||
synchronized (directionFromStartToNextMarkCacheLock) {
|
||||
directionFromStartToNextMarkCache = null;
|
||||
listeningTo.removeListener(StartToNextMarkCacheInvalidationListener.this);
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void speedAveragingChanged(long oldMillisecondsOverWhichToAverage, long newMillisecondsOverWhichToAverage) {
|
||||
new Thread("StartToNextMarkCacheInvalidationListener.gpsFixReceived for buoy "
|
||||
+ listeningTo.getTrackedItem().getName()) {
|
||||
getExecutor().execute(new Runnable() {
|
||||
public void run() {
|
||||
synchronized (directionFromStartToNextMarkCacheLock) {
|
||||
directionFromStartToNextMarkCache = null;
|
||||
listeningTo.removeListener(StartToNextMarkCacheInvalidationListener.this);
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#Tue Jan 03 14:27:36 CET 2012
|
||||
#Tue Jan 03 17:31:35 CET 2012
|
||||
eclipse.preferences.version=1
|
||||
jarsExcludedFromWebInfLib=
|
||||
lastWarOutDir=C\:/data/SAP/sailing/workspace/java/com.sap.sailing.gwt.ui
|
||||
launchConfigExternalUrlPrefix=
|
||||
warSrcDir=war
|
||||
warSrcDir=
|
||||
warSrcDirIsOutput=false
|
||||
Regular → Executable
+3
-3
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
|
||||
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
|
||||
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
|
||||
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
|
||||
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
|
||||
<listEntry value="com.sap.sailing.gwt.ui.UserManagement"/>
|
||||
<listEntry value="com.sap.sailing.gwt.ui.Leaderboard"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/gwt/AdminConsole.html"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
@@ -19,7 +19,7 @@
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war "${project_loc:com.sap.sailing.gwt.ui}" -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/UserManagement.html com.sap.sailing.gwt.ui.UserManagement"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-war C:\data\SAP\sailing\workspace\java\com.sap.sailing.gwt.ui -noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/UserManagement.html com.sap.sailing.gwt.ui.UserManagement -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m"/>
|
||||
</launchConfiguration>
|
||||
Reference in new issue
Block a user