[Webfunds-devel] SOX Reply constructor changes

Ian Grigg iang@systemics.com
Sun, 24 Sep 2000 19:31:38 -0400 (AST)


I made some smallish but breaking changes to the Request / Reply
juncture.  It will break any SOX requests you happen to have
written.  Here's what you have to do to get back into step:

    * XXXReply constructors now look like

        public XXX(XXXRequest request, /* ... */)
        {
            super(request);
            //...
        }

      instead of using requestId they use the request itself.

      This change applies to all of them!  Including the ones
      that do data buf recovery.  I haven't as yet changed over
      the stream ones but will.

    * All Replies must now be recovered by doing:

        XXXReply xxx = new XXXReply(req, data);

    * test code will need to change such that the request is
      available first.  I've done this by making Reply tests
      duplicate the functions of Request tests;  they now
      create and write a matching Request before each Reply.

    * XXXReply.example() method needs a XXXRequest as well,
      so I've added:

        public static XXXReply example()
        {
            return example(XXXRequest.example());
        }

      and converted the old example into example(XXXRequest r) 
 
This is all required so that we can change the format of the
reply.  Before this change set, it was impossible to determine 
what Request version was matched to the Reply.
 
It's as bit clumsy.  But, as a bootstrapping path, I can now
add an independant Reply version number in so that the two
can be delinked at some future stage.  For now they are Yin
and Yang, always together....
 
I've also eliminated the IOException in all but the internal
encode() and decode() methods.

All of this has been tested a little bit and doesn't seem to
break anything, but as it is quite a persistant change, worth
keeping an eye on.  I'm going to be doing more testing on other
machines, etc tonight.

iang