[e-cvs] cvs commit: e/src/jsrc/net/captp/tables CommTable.java ExportsTable.java

markm@eros.cs.jhu.edu markm@eros.cs.jhu.edu
Wed, 25 Jul 2001 01:53:43 -0400


markm       01/07/25 01:53:43

  Modified:    src/jsrc/net/captp/jcomm ProxyConnection.java
                        RemoteVowHandler.java
               src/jsrc/net/captp/tables CommTable.java ExportsTable.java
  Log:
  makeQuestion ok.  Now stops at DelayedRedirector

Revision  Changes    Path
1.16      +6 -2      e/src/jsrc/net/captp/jcomm/ProxyConnection.java

Index: ProxyConnection.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/ProxyConnection.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ProxyConnection.java	2001/07/22 05:29:55	1.15
+++ ProxyConnection.java	2001/07/25 05:53:43	1.16
@@ -315,7 +315,11 @@
      *
      */
     /*package*/ ProxyResolver makeQuestion() {
-        throw new RuntimeException("XXX not yet implemented");
+        int index = myQuestions.bind(null);
+        RemoteVowHandler handler = new RemoteVowHandler(this, -index);
+        ProxyResolver result = handler.myResolver;
+        myQuestions.put(index, result);
+        return result;
     }
     
     /**
@@ -615,7 +619,7 @@
         }
         Object recip = getIncoming(recipPos);
         Ref answer = E.sendAll(recip, verb, args);
-        myAnswers.put(answerPos, answer);
+        myAnswers.bind(answerPos, answer);
         E.sendOnly(answer, "whenMoreResolved", redirector);
     }
     



1.2       +3 -6      e/src/jsrc/net/captp/jcomm/RemoteVowHandler.java

Index: RemoteVowHandler.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/jcomm/RemoteVowHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RemoteVowHandler.java	2001/04/29 02:57:29	1.1
+++ RemoteVowHandler.java	2001/07/25 05:53:43	1.2
@@ -19,6 +19,7 @@
 Contributor(s): ______________________________________.
 */
 
+import net.captp.tables.QuestionsTable;
 
 /**
  * Handles an unresolved remote reference (a RemoteVow).
@@ -33,11 +34,7 @@
      * @param connection The ProxyConnection to communicate via
      * @param pos The Imports or Questions map pos of the object
      */
-    /*package*/ RemoteVowHandler(ProxyConnection connection,
-                                 int pos)
-    {
-        super(connection,
-              pos,
-              null);
+    /*package*/ RemoteVowHandler(ProxyConnection connection, int pos) {
+        super(connection, pos, null);
     }
 }



1.3       +28 -20    e/src/jsrc/net/captp/tables/CommTable.java

Index: CommTable.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/tables/CommTable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CommTable.java	2001/07/08 02:13:04	1.2
+++ CommTable.java	2001/07/25 05:53:43	1.3
@@ -211,25 +211,6 @@
     }            
 
     /**
-     * Allocates a free index, put value there, and returns that index. <p>
-     *
-     * Subclasses may override and send-super to initialize their parallel 
-     * arrays. 
-     */
-    public int put(Object value) {
-        if (myFreeHead == 0) {
-            growToHold(myCapacity);
-        }
-        int result = -myFreeHead;
-        mustBeFree(result);
-        myFreeHead = myFreeList[result];
-        myFreeList[result] = 1;
-        myStuff[result] = value;
-        mySize++;
-        return result;
-    }
-    
-    /**
      * Deallocates an allocated index. <p>
      *
      * Subclasses may override and send-super in order to clear their 
@@ -321,9 +302,36 @@
     }
     
     /**
-     * Allocate index (which must have been free), and put value there.
+     * Assign value to the already allocated index.
      */
     public void put(int index, Object value) {
+        mustBeAlloced(index);
+        myStuff[index] = value;
+    }
+    
+    /**
+     * Allocates a free index, put value there, and returns that index. <p>
+     *
+     * Subclasses may override and send-super to initialize their parallel 
+     * arrays. 
+     */
+    public int bind(Object value) {
+        if (myFreeHead == 0) {
+            growToHold(myCapacity);
+        }
+        int result = -myFreeHead;
+        mustBeFree(result);
+        myFreeHead = myFreeList[result];
+        myFreeList[result] = 1;
+        myStuff[result] = value;
+        mySize++;
+        return result;
+    }
+    
+    /**
+     * Allocate index (which must have been free), and put value there.
+     */
+    public void bind(int index, Object value) {
         alloc(index);
         myStuff[index] = value;
     }



1.2       +2 -2      e/src/jsrc/net/captp/tables/ExportsTable.java

Index: ExportsTable.java
===================================================================
RCS file: /cvs/e/src/jsrc/net/captp/tables/ExportsTable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ExportsTable.java	2001/04/29 02:57:29	1.1
+++ ExportsTable.java	2001/07/25 05:53:43	1.2
@@ -75,7 +75,7 @@
      */
     public int newFarPos(Object pbp) {
         pbp = PassByProxyGuard.THE_ONE.coerce(pbp, null);
-        int index = put(pbp);
+        int index = bind(pbp);
         myPBPMap.putInt(pbp, index, true);
         return index;
     }
@@ -95,6 +95,6 @@
             throw new RuntimeException("internal: " + localVow + 
                                        " isn't eventual");
         }
-        return put(localVow);
+        return bind(localVow);
     }
 }