Changeset 4 for src/main/java
- Timestamp:
- 09/18/19 10:00:24 (5 years ago)
- Location:
- src/main/java/geniusweb/partiesserver
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/geniusweb/partiesserver/RunningPartiesUpdater.java
r1 r4 5 5 import geniusweb.partiesserver.repository.RunningPartiesRepo; 6 6 import geniusweb.partiesserver.repository.RunningParty; 7 import geniusweb.party.Party; 7 8 import tudelft.utilities.logging.ReportToLogger; 8 9 import tudelft.utilities.logging.Reporter; … … 11 12 * 12 13 * This object keeps the {@link RunningPartiesRepo} up to date. Main job is to 13 * remove parties that have been timed out. Start and run only once. 14 * remove parties that have been timed out. When a party times out, 15 * it calls {@link Party#terminate()} but that might fail to stop a party. 16 * In the end, the protocol should close the connection after the deadline. Start and run only once. 14 17 */ 15 18 public class RunningPartiesUpdater implements Runnable { … … 64 67 if (now >= party.getEndDate().getTime() + KILL_DELAY) { 65 68 running.remove(party.getID()); 66 log.log(Level.WARNING, "party " + party.getID() + " was timed out and terminated");69 log.log(Level.WARNING, "party " + party.getID() + " still running 2s after deadline. Removed now."); 67 70 } 68 71 } -
src/main/java/geniusweb/partiesserver/repository/RunningParty.java
r1 r4 12 12 import geniusweb.actions.PartyId; 13 13 import geniusweb.connection.DefaultConnection; 14 import geniusweb.partiesserver.RunningPartiesUpdater; 14 15 import geniusweb.party.Party; 15 16 import geniusweb.party.inform.Inform; … … 100 101 * @param name The name, this should match the filename in the repo 101 102 * (without the .jar). 102 * @param maxRunTimeMS the maximum runtime for this party (ms) 103 * @param maxRunTimeMS the maximum runtime for this party (ms). The {@link RunningPartiesUpdater} 104 * will keep an eye on the time and handle removal after time is up. 105 * 103 106 */ 104 107 public static RunningParty create(Party party, String name, -
src/main/java/geniusweb/partiesserver/websocket/PartySocket.java
r1 r4 125 125 RunningParty party = runningparties.get(partyID); 126 126 if (party != null) { 127 // first sniff, to ensure the deadlines are updated first. 128 sniff(info, party); 127 129 log.log(Level.FINE, "Inform " + partyID + ": " + info); 128 130 try { … … 132 134 log.log(Level.WARNING, "Party failed on inform:", e); 133 135 } 134 sniff(info, party);135 136 } // else dead but that's handled in the listener above 136 137 }
Note:
See TracChangeset
for help on using the changeset viewer.