mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 12:03:58 +00:00
fixed serialization properties of new CompetitorProviderFromRaceColumnsAndRegattaLike listeners
This commit is contained in:
1 parent
a4a62bf8dc
commit
b36c046463
1 file changed
+15
+15
@@ -54,6 +54,13 @@ public class CompetitorProviderFromRaceColumnsAndRegattaLike {
|
||||
public CompetitorProviderFromRaceColumnsAndRegattaLike(HasRaceColumnsAndRegattaLike provider) {
|
||||
super();
|
||||
this.provider = provider;
|
||||
// A note regarding listener serializability: RaceLogListener and RegattaLogListener objects
|
||||
// don't need to be serializable as the log listeners are a transient structure. The race column
|
||||
// listeners, however, need to explicitly declare that they are transient.
|
||||
// This enclosing object is intended not to be serialized and shall be re-constructed by
|
||||
// its users after de-serialization. Therefore, the transient-ness of the log listeners works
|
||||
// as intended, and the race column listener explicitly returns true from its isTransient()
|
||||
// method.
|
||||
regattaLogCompetitorsCacheInvalidationListener = new BaseRegattaLogEventVisitor() {
|
||||
@Override
|
||||
public void visit(RegattaLogRegisterCompetitorEvent event) {
|
||||
@@ -94,6 +101,14 @@ public class CompetitorProviderFromRaceColumnsAndRegattaLike {
|
||||
@Override
|
||||
public void defaultAction() {}
|
||||
|
||||
/**
|
||||
* As the entire provider object is considered transient, its listeners are so, too.
|
||||
*/
|
||||
@Override
|
||||
public boolean isTransient() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trackedRaceLinked(RaceColumn raceColumn, Fleet fleet, TrackedRace trackedRace) {
|
||||
invalidateAllCompetitorsCache();
|
||||
|
||||
Reference in new issue
Block a user