Changeset 9 for simplerunner/src/main
- Timestamp:
- 11/28/19 14:40:48 (5 years ago)
- Location:
- simplerunner/src/main/java/geniusweb/simplerunner
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
simplerunner/src/main/java/geniusweb/simplerunner/BasicConnection.java
r1 r9 4 4 import java.net.URI; 5 5 6 import geniusweb.connection.Connection ;6 import geniusweb.connection.ConnectionEnd; 7 7 import geniusweb.references.Reference; 8 8 import tudelft.utilities.listener.DefaultListenable; … … 17 17 */ 18 18 public class BasicConnection<IN, OUT> extends DefaultListenable<IN> 19 implements Connection <IN, OUT> {19 implements ConnectionEnd<IN, OUT> { 20 20 private final Reference reference; 21 21 private final URI uri; -
simplerunner/src/main/java/geniusweb/simplerunner/ClassPathConnectionFactory.java
r1 r9 13 13 import geniusweb.party.Party; 14 14 import geniusweb.party.inform.Inform; 15 import geniusweb.protocol.partyconnection. ConnectionWithParty;16 import geniusweb.protocol.partyconnection. ConnectionWithPartyFactory;15 import geniusweb.protocol.partyconnection.ProtocolToPartyConn; 16 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory; 17 17 import geniusweb.references.Reference; 18 18 import tudelft.utilities.repository.NoResourcesNowException; … … 25 25 * 26 26 */ 27 public class ClassPathConnectionFactory implements ConnectionWithPartyFactory {27 public class ClassPathConnectionFactory implements ProtocolToPartyConnFactory { 28 28 private static final String SCHEME = "classpath"; 29 29 private static int serialcounter = 1; … … 31 31 32 32 @Override 33 public ConnectionWithPartyconnect(Reference reference) {33 public ProtocolToPartyConn connect(Reference reference) { 34 34 // set up the whole other party including the connection to it. 35 35 String classpath = getClassPath(reference.getURI()); … … 42 42 uri("classpath:" + reference.getURI().getSchemeSpecificPart() 43 43 + "." + (serialcounter++))); 44 party2protocol.init(action -> protocol2party.notify Change(action));45 protocol2party.init(info -> party2protocol.notify Change(info));44 party2protocol.init(action -> protocol2party.notifyListeners(action)); 45 protocol2party.init(info -> party2protocol.notifyListeners(info)); 46 46 47 47 party.connect(party2protocol); … … 102 102 103 103 @Override 104 public List< ConnectionWithParty> connect(List<Reference> references)104 public List<ProtocolToPartyConn> connect(List<Reference> references) 105 105 throws IOException, NoResourcesNowException { 106 List< ConnectionWithParty> connections = new LinkedList<>();106 List<ProtocolToPartyConn> connections = new LinkedList<>(); 107 107 for (Reference partyref : references) { 108 108 connections.add(connect(partyref)); … … 114 114 115 115 class BasicConnectionWithParty extends BasicConnection<Action, Inform> 116 implements ConnectionWithParty{116 implements ProtocolToPartyConn { 117 117 118 118 private PartyId id; -
simplerunner/src/main/java/geniusweb/simplerunner/NegoRunner.java
r1 r9 13 13 import geniusweb.protocol.NegoProtocol; 14 14 import geniusweb.protocol.NegoSettings; 15 import geniusweb.protocol.partyconnection. ConnectionWithPartyFactory;15 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory; 16 16 import geniusweb.protocol.session.SessionSettings; 17 17 import tudelft.utilities.logging.ReportToLogger; … … 27 27 private final NegoSettings settings; 28 28 private final NegoProtocol protocol; 29 private final ConnectionWithPartyFactory connectionfactory;29 private final ProtocolToPartyConnFactory connectionfactory; 30 30 private final Reporter log; 31 31 private final static ObjectMapper jackson = new ObjectMapper(); 32 32 33 33 public NegoRunner(NegoSettings settings, 34 ConnectionWithPartyFactory connectionfactory, Reporter logger) {34 ProtocolToPartyConnFactory connectionfactory, Reporter logger) { 35 35 if (settings == null || connectionfactory == null) { 36 36 throw new NullPointerException("Arguments must be not null");
Note:
See TracChangeset
for help on using the changeset viewer.