*/
public class Freenet7Interface {
+ /** Random number to differentiate several jSites. */
+ private static final int number = (int) (Math.random() * Integer.MAX_VALUE);
+
/** Counter. */
private static int counter = 0;
*/
public void setNodeAddress(String hostname) {
node = new Node(hostname);
- connection = new Connection(node, "connection-" + counter++);
+ connection = new Connection(node, "jSite-" + number + "-connection-" + counter++);
}
/**
*/
public void setNodeAddress(String hostname, int port) {
node = new Node(hostname, port);
- connection = new Connection(node, "connection-" + counter++);
+ connection = new Connection(node, "jSite-" + number + "-connection-" + counter++);
}
/**
public void setNode(de.todesbaum.jsite.application.Node node) {
if (node != null) {
this.node = new Node(node.getHostname(), node.getPort());
- connection = new Connection(node, "connection-" + counter++);
+ connection = new Connection(node, "jSite-" + number + "-connection-" + counter++);
} else {
this.node = null;
connection = null;
*/
public class ProjectInserter implements FileScannerListener, Runnable {
+ /** Random number for FCP instances. */
+ private static final int random = (int) (Math.random() * Integer.MAX_VALUE);
+
/** Counter for FCP connection identifier. */
private static int counter = 0;
List<String> files = fileScanner.getFiles();
/* create connection to node */
- Connection connection = freenetInterface.getConnection("project-insert-" + counter++);
+ Connection connection = freenetInterface.getConnection("project-insert-" + random + counter++);
boolean connected = false;
Throwable cause = null;
try {