Forwarding requests to another object


You can use the _forward operation in the Object pseudo interface to forward a request to a different object:

  pseudo interface servant (Object) {
    void _forward (in Object location) raises (ORBLink::Forward);
  }

Within the body of a corba:define-method definition corresponding to an implementation object r, the function invocation

(op:_forward r p)

will forward to the object designated by p the request that was received by the object r.

This functionality only works if the original request was received remotely by r.

It is implemented at the IIOP level by returning to the invoker a reply of type LOCATION_FORWARD with the IOR of p in the IIOP message body. All subsequent requests on that proxy (which can be in the address space of a non-Lisp ORB) which forwarded the original request to r will be routed directly to p.

op:_forward signals an ORBLink:Forward condition which is handled by the ORB when servicing a remote request. This implementation detail is normally transparent to the user and should not be relied upon.