Moved callback initialisation from start() to constructor so it can be

accessed outside the lock.
This commit is contained in:
akwizgran
2011-10-08 12:46:35 +01:00
parent 7eaefd97cb
commit 5f40015ec2
13 changed files with 88 additions and 101 deletions

View File

@@ -11,6 +11,11 @@ public interface TransportPlugin {
/** Returns the plugin's transport identifier. */
TransportId getId();
/** Starts the plugin. */
void start(Map<String, String> localProperties,
Map<ContactId, Map<String, String>> remoteProperties,
Map<String, String> config) throws IOException;
/**
* Stops the plugin. No further connections will be passed to the callback
* after this method has returned.

View File

@@ -1,8 +1,5 @@
package net.sf.briar.api.transport.batch;
import java.io.IOException;
import java.util.Map;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.transport.TransportPlugin;
@@ -12,15 +9,6 @@ import net.sf.briar.api.transport.TransportPlugin;
*/
public interface BatchTransportPlugin extends TransportPlugin {
/**
* Starts the plugin. Any connections that are later initiated by contacts
* or established through polling will be passed to the given callback.
*/
void start(Map<String, String> localProperties,
Map<ContactId, Map<String, String>> remoteProperties,
Map<String, String> config, BatchTransportCallback c)
throws IOException;
/**
* Attempts to create and return a BatchTransportReader for the given
* contact using the current transport and configuration properties.

View File

@@ -1,8 +1,5 @@
package net.sf.briar.api.transport.stream;
import java.io.IOException;
import java.util.Map;
import net.sf.briar.api.ContactId;
import net.sf.briar.api.transport.TransportPlugin;
@@ -12,15 +9,6 @@ import net.sf.briar.api.transport.TransportPlugin;
*/
public interface StreamTransportPlugin extends TransportPlugin {
/**
* Starts the plugin. Any connections that are later initiated by contacts
* or established through polling will be passed to the given callback.
*/
void start(Map<String, String> localProperties,
Map<ContactId, Map<String, String>> remoteProperties,
Map<String, String> config, StreamTransportCallback c)
throws IOException;
/**
* Attempts to create and return a StreamTransportConnection to the given
* contact using the current transport and configuration properties.