Changes between Initial Version and Version 1 of KaRMI/CallProtocol


Ignore:
Timestamp:
02/02/05 12:43:03 (8 years ago)
Author:
hauma
Comment:

Created initial version.

Legend:

Unmodified
Added
Removed
Modified
  • KaRMI/CallProtocol

    v1 v1  
     1= The KaRMI Call Protocol = 
     2 
     3Currently, the KaRMI call protocol for a remote method invocation 
     4looks approximately like the following: 
     5 
     6== Client side == 
     7{{{ 
     8#!java 
     9ClientConnection c = Technology.getContext(...) 
     10 
     11c.openSendCall() 
     12// marshal arguments 
     13c.closeSendCall() 
     14 
     15normalReturn = c.openReceiveResult() 
     16if (normalReturn) { 
     17    // unmarshal result 
     18} else { 
     19    // unmarshal exeption ex 
     20} 
     21c.closeReceiveResult() 
     22 
     23if (normalReturn) { 
     24    return result; 
     25} else { 
     26    throw ex; 
     27} 
     28}}} 
     29 
     30== Server side == 
     31{{{ 
     32#!java 
     33// The connection c belongs one-to-one to the serving  
     34// thread. 
     35ServerConnection c; 
     36 
     37c.openReceiveCall() 
     38// unmarshal arguments 
     39c.closeReceiveCall() 
     40 
     41try { 
     42    try { 
     43        // application code 
     44    } catch (Exception ex) { 
     45        c.openSendResult(false) 
     46        // marshal ex 
     47        throw ex 
     48    } 
     49    c.openSendResult(true) 
     50    // marshal result 
     51} catch (Exception ex) {} 
     52c.closeSendResult() 
     53}}}