Use dedicated classes for transport properties and configs.

This commit is contained in:
akwizgran
2011-10-11 17:28:47 +01:00
parent 68b82ae826
commit a49a95347f
34 changed files with 341 additions and 308 deletions

View File

@@ -10,6 +10,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.TransportConfig;
import net.sf.briar.api.TransportProperties;
import net.sf.briar.api.plugins.StreamTransportCallback;
import net.sf.briar.api.plugins.StreamTransportPlugin;
import net.sf.briar.api.transport.StreamTransportConnection;
@@ -41,9 +43,9 @@ implements StreamTransportPlugin {
}
@Override
public synchronized void start(Map<String, String> localProperties,
Map<ContactId, Map<String, String>> remoteProperties,
Map<String, String> config) throws IOException {
public synchronized void start(TransportProperties localProperties,
Map<ContactId, TransportProperties> remoteProperties,
TransportConfig config) throws IOException {
super.start(localProperties, remoteProperties, config);
executor.execute(createBinder());
}
@@ -129,9 +131,8 @@ implements StreamTransportPlugin {
}
@Override
public synchronized void setLocalProperties(
Map<String, String> properties) {
super.setLocalProperties(properties);
public synchronized void setLocalProperties(TransportProperties p) {
super.setLocalProperties(p);
// Close and reopen the socket if its address has changed
if(socket != null) {
SocketAddress addr = socket.getLocalSocketAddress();