Changeset 8 for src/main/java/geniusweb/partiesserver/repository
- Timestamp:
- 11/28/19 14:41:10 (5 years ago)
- Location:
- src/main/java/geniusweb/partiesserver/repository
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/geniusweb/partiesserver/repository/AvailablePartiesRepo.java
r1 r8 12 12 * Stores all currently available parties that can be run. 13 13 */ 14 public class AvailablePartiesRepo extends DefaultListenable<String> implements Repository<String, AvailableParty> { 14 public class AvailablePartiesRepo extends DefaultListenable<String> 15 implements Repository<String, AvailableParty> { 15 16 private static final AvailablePartiesRepo instance = new AvailablePartiesRepo(); 16 17 … … 37 38 public void put(AvailableParty entity) { 38 39 availableParties.put(entity.getID(), entity); 39 notify Change(entity.getID());40 notifyListeners(entity.getID()); 40 41 } 41 42 … … 43 44 public void remove(String id) { 44 45 availableParties.remove(id); 45 notify Change(id);46 notifyListeners(id); 46 47 } 47 48 -
src/main/java/geniusweb/partiesserver/repository/RunningPartiesRepo.java
r1 r8 74 74 runningParties.put(id, newParty); 75 75 } 76 notify Change(id);76 notifyListeners(id); 77 77 } 78 78 … … 87 87 runningParties.put(id, newParty); 88 88 } 89 notify Change(id);89 notifyListeners(id); 90 90 91 91 } … … 125 125 } 126 126 } 127 notify Change(id);127 notifyListeners(id); 128 128 } 129 129 -
src/main/java/geniusweb/partiesserver/repository/RunningParty.java
r4 r8 9 9 import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; 10 10 11 import geniusweb.actions.Action;12 11 import geniusweb.actions.PartyId; 13 12 import geniusweb.connection.DefaultConnection; 14 13 import geniusweb.partiesserver.RunningPartiesUpdater; 14 import geniusweb.partiesserver.websocket.PartySocket; 15 15 import geniusweb.party.Party; 16 16 import geniusweb.party.inform.Inform; … … 40 40 * set when someone contacts our socket. null if not set. 41 41 */ 42 private final transient DefaultConnection<Inform, Action>connection;42 private final transient PartySocket connection; 43 43 44 44 /** … … 58 58 */ 59 59 protected RunningParty(Party party, PartyId id, String name, Date start, 60 Date end, DefaultConnectionconn) {60 Date end, PartySocket conn) { 61 61 if (party == null || id == null || name == null || start == null 62 62 || end == null) { … … 101 101 * @param name The name, this should match the filename in the repo 102 102 * (without the .jar). 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. 103 * @param maxRunTimeMS the maximum runtime for this party (ms). The 104 * {@link RunningPartiesUpdater} will keep an eye on the 105 * time and handle removal after time is up. 105 106 * 106 107 */ … … 212 213 */ 213 214 public void inform(Inform info) { 214 connection.notify Change(info);215 connection.notifyListeners(info); 215 216 } 216 217 … … 223 224 * @throws IllegalStateException if the party is already connected. 224 225 */ 225 public RunningParty withConnection( 226 DefaultConnection<Inform, Action> newconn) { 226 public RunningParty withConnection(PartySocket newconn) { 227 227 if (newconn == null) 228 228 throw new NullPointerException("newconn must be not null");
Note:
See TracChangeset
for help on using the changeset viewer.