Author: toad
Date: 2008-06-14 13:59:52 +0000 (Sat, 14 Jun 2008)
New Revision: 20342
Modified:
branches/db4o/freenet/src/freenet/node/fcp/ClientRequest.java
branches/db4o/freenet/src/freenet/node/fcp/FCPClient.java
branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
branches/db4o/freenet/src/freenet/node/fcp/FCPServer.java
branches/db4o/freenet/src/freenet/node/fcp/WatchGlobal.java
Log:
Remove FCPServer from FCPClient, also some minor fixes
Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientRequest.java
2008-06-14 13:55:56 UTC (rev 20341)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientRequest.java
2008-06-14 13:59:52 UTC (rev 20342)
@@ -368,7 +368,7 @@
fs.put(name, bucket.toFieldSet());
}
- public void restartAsync() {
+ public void restartAsync(Executor executor) {
synchronized(this) {
this.started = false;
}
Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPClient.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPClient.java 2008-06-14
13:55:56 UTC (rev 20341)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPClient.java 2008-06-14
13:59:52 UTC (rev 20342)
@@ -16,14 +16,13 @@
*/
public class FCPClient {
- public FCPClient(String name2, FCPServer server, FCPConnectionHandler
handler, boolean isGlobalQueue, RequestCompletionCallback cb, short
persistenceType) {
+ public FCPClient(String name2, FCPConnectionHandler handler, boolean
isGlobalQueue, RequestCompletionCallback cb, short persistenceType) {
this.name = name2;
if(name == null) throw new NullPointerException();
this.currentConnection = handler;
this.runningPersistentRequests = new HashSet();
this.completedUnackedRequests = new Vector();
this.clientRequestsByIdentifier = new HashMap();
- this.server = server;
this.isGlobalQueue = isGlobalQueue;
this.persistenceType = persistenceType;
assert(persistenceType == ClientRequest.PERSIST_FOREVER ||
persistenceType == ClientRequest.PERSIST_REBOOT);
@@ -44,8 +43,6 @@
/** The client's Name sent in the ClientHello message */
final String name;
- /** The FCPServer */
- final FCPServer server;
/** The current connection handler, if any. */
private transient FCPConnectionHandler currentConnection;
/** Currently running persistent requests */
@@ -87,7 +84,7 @@
* Called when a client request has finished, but is persistent. It has
not been
* acked yet, so it should be moved to the unacked-completed-requests
set.
*/
- public void finishedClientRequest(ClientRequest get) {
+ public void finishedClientRequest(ClientRequest get, FCPServer server) {
assert(get.persistenceType == persistenceType);
synchronized(this) {
if(runningPersistentRequests.remove(get)) {
@@ -144,7 +141,7 @@
}
}
- public void removeByIdentifier(String identifier, boolean kill) throws
MessageInvalidException {
+ public void removeByIdentifier(String identifier, boolean kill,
FCPServer server) throws MessageInvalidException {
ClientRequest req;
boolean logMINOR = Logger.shouldLog(Logger.MINOR, this);
if(logMINOR) Logger.minor(this,
"removeByIdentifier("+identifier+ ',' +kill+ ')');
@@ -190,7 +187,7 @@
* @param verbosityMask If so, what verbosity mask to use (to filter
messages
* generated by the global queue).
*/
- public void setWatchGlobal(boolean enabled, int verbosityMask) {
+ public void setWatchGlobal(boolean enabled, int verbosityMask,
FCPServer server) {
if(isGlobalQueue) {
Logger.error(this, "Set watch global on global queue!");
return;
Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
2008-06-14 13:55:56 UTC (rev 20341)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
2008-06-14 13:59:52 UTC (rev 20342)
@@ -217,7 +217,7 @@
success = !requestsByIdentifier.containsKey(id);
if(success) {
try {
- cp = new ClientPut(this, message);
+ cp = new ClientPut(this, message,
server);
} catch (IdentifierCollisionException e) {
success = false;
} catch (MessageInvalidException e) {
Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPServer.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPServer.java 2008-06-14
13:55:56 UTC (rev 20341)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPServer.java 2008-06-14
13:59:52 UTC (rev 20342)
@@ -119,7 +119,7 @@
defaultFetchContext = client.getFetchContext();
defaultInsertContext = client.getInsertContext(false);
- globalRebootClient = new FCPClient("Global Queue", this, null,
true, null, ClientRequest.PERSIST_REBOOT);
+ globalRebootClient = new FCPClient("Global Queue", null, true,
null, ClientRequest.PERSIST_REBOOT);
logMINOR = Logger.shouldLog(Logger.MINOR, this);
Modified: branches/db4o/freenet/src/freenet/node/fcp/WatchGlobal.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/WatchGlobal.java 2008-06-14
13:55:56 UTC (rev 20341)
+++ branches/db4o/freenet/src/freenet/node/fcp/WatchGlobal.java 2008-06-14
13:59:52 UTC (rev 20342)
@@ -39,8 +39,8 @@
public void run(FCPConnectionHandler handler, Node node)
throws MessageInvalidException {
- handler.getRebootClient().setWatchGlobal(enabled,
verbosityMask);
- handler.getForeverClient().setWatchGlobal(enabled,
verbosityMask);
+ handler.getRebootClient().setWatchGlobal(enabled,
verbosityMask, node.clientCore.getFCPServer());
+ handler.getForeverClient().setWatchGlobal(enabled,
verbosityMask, node.clientCore.getFCPServer());
}
}