Author: toad
Date: 2007-03-16 23:13:05 +0000 (Fri, 16 Mar 2007)
New Revision: 12163

Modified:
   trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
   trunk/freenet/src/freenet/node/SendableGet.java
   trunk/freenet/src/freenet/node/SendableInsert.java
   trunk/freenet/src/freenet/node/SendableRequest.java
   trunk/freenet/src/freenet/node/SimpleSendableInsert.java
Log:
Refactor: Make SendableRequest an abstract class, not an interface

Modified: trunk/freenet/src/freenet/client/async/SingleBlockInserter.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleBlockInserter.java     
2007-03-16 23:09:57 UTC (rev 12162)
+++ trunk/freenet/src/freenet/client/async/SingleBlockInserter.java     
2007-03-16 23:13:05 UTC (rev 12163)
@@ -20,13 +20,14 @@
 import freenet.node.NodeClientCore;
 import freenet.node.SendableInsert;
 import freenet.support.Logger;
+import freenet.support.RandomGrabArray;
 import freenet.support.SimpleFieldSet;
 import freenet.support.api.Bucket;

 /**
  * Insert *ONE KEY*.
  */
-public class SingleBlockInserter implements SendableInsert, ClientPutState {
+public class SingleBlockInserter extends SendableInsert implements 
ClientPutState {

        private static boolean logMINOR;
        final Bucket sourceData;

Modified: trunk/freenet/src/freenet/node/SendableGet.java
===================================================================
--- trunk/freenet/src/freenet/node/SendableGet.java     2007-03-16 23:09:57 UTC 
(rev 12162)
+++ trunk/freenet/src/freenet/node/SendableGet.java     2007-03-16 23:13:05 UTC 
(rev 12163)
@@ -12,7 +12,7 @@
 /**
  * A low-level key fetch which can be sent immediately. @see SendableRequest
  */
-public abstract class SendableGet implements SendableRequest {
+public abstract class SendableGet extends SendableRequest {

        /** Is this an SSK? */
        public abstract boolean isSSK();

Modified: trunk/freenet/src/freenet/node/SendableInsert.java
===================================================================
--- trunk/freenet/src/freenet/node/SendableInsert.java  2007-03-16 23:09:57 UTC 
(rev 12162)
+++ trunk/freenet/src/freenet/node/SendableInsert.java  2007-03-16 23:13:05 UTC 
(rev 12163)
@@ -9,12 +9,12 @@
  * then, when it is time to send, create a thread, send the request, and call 
the 
  * callback below.
  */
-public interface SendableInsert extends SendableRequest {
+public abstract class SendableInsert extends SendableRequest {

        /** Called when we successfully insert the data */
-       public void onSuccess();
+       public abstract void onSuccess();

        /** Called when we don't! */
-       public void onFailure(LowLevelPutException e);
+       public abstract void onFailure(LowLevelPutException e);

 }

Modified: trunk/freenet/src/freenet/node/SendableRequest.java
===================================================================
--- trunk/freenet/src/freenet/node/SendableRequest.java 2007-03-16 23:09:57 UTC 
(rev 12162)
+++ trunk/freenet/src/freenet/node/SendableRequest.java 2007-03-16 23:13:05 UTC 
(rev 12163)
@@ -7,23 +7,23 @@
  * A low-level request which can be sent immediately. These are registered
  * on the ClientRequestScheduler.
  */
-public interface SendableRequest extends RandomGrabArrayItem {
+public abstract class SendableRequest implements RandomGrabArrayItem {

        /** Get the priority class of the request. */
-       public short getPriorityClass();
+       public abstract short getPriorityClass();

-       public int getRetryCount();
+       public abstract int getRetryCount();

        /** ONLY called by RequestStarter. Start the actual request using the 
NodeClientCore
         * provided. The request has been removed from the structure already, 
if canRemove().
         * @return True if a request was sent, false otherwise (in which case 
the request will
         * be removed if it hasn't already been). */
-       public boolean send(NodeClientCore node);
+       public abstract boolean send(NodeClientCore node);

        /** Get client context object */
-       public Object getClient();
+       public abstract Object getClient();

        /** Get the ClientRequest */
-       public ClientRequester getClientRequest();
+       public abstract ClientRequester getClientRequest();

 }

Modified: trunk/freenet/src/freenet/node/SimpleSendableInsert.java
===================================================================
--- trunk/freenet/src/freenet/node/SimpleSendableInsert.java    2007-03-16 
23:09:57 UTC (rev 12162)
+++ trunk/freenet/src/freenet/node/SimpleSendableInsert.java    2007-03-16 
23:13:05 UTC (rev 12163)
@@ -12,7 +12,7 @@
  * block. Not designed for use by the client layer. Used by the node layer for 
the
  * 1 in every 200 successful requests which starts an insert.
  */
-public class SimpleSendableInsert implements SendableInsert {
+public class SimpleSendableInsert extends SendableInsert {

        public final NodeClientCore node;
        public final KeyBlock block;


Reply via email to