Previous Table of Contents Next


21.3.10 Server-Side Interception Point Flow


   A ServerRequestInterceptor instance is registered with the ORB (see Section 21.7, “Registering Interceptors,? on page 21-50). The ORB logically maintains an ordered list of server-side Interceptors. The Interceptor list is traversed in order on the receiving interception points and in reverse order on the sending interception points.

   21.3.10.1 Server-side Flow Rules

    The server-side flow rules are derived from the general flow rules (see Section 21.3.2, “General Flow Rules,? on page 21-7).

   21.3.10.2 Additional Server-side Details

   If, during request processing, a request is canceled because of an ORB shutdown, send_exception is called with the system exception BAD_INV_ORDER with a minor code of 4 (ORB has shutdown).

   If a request is canceled for any other reason (for example, a GIOP cancel message has been received), send_exception is called with the system exception TRANSIENT with a standard minor code of 3.

   The following statement is made about the GIOP close connection message (CORBA v2.3 15-45):

   “If the ORB sending the CloseConnection is a server, or bidirectional GIOP is in use, the sending ORB must not currently be processing any Requests from the other side.?

   With respect to portable Interceptors, “...processing any Requests...? means that receive_request_service_contexts has been called on any Interceptor and no ending interception point has yet been invoked.

   On oneway requests, there is no reply sent to the client; however, the target is called and the server can construct an empty reply. Since closure is necessary, this reply is tracked and send_reply is called (unless an exception occurs, in which case send_exception is called).

   Asynchronous requests, from the server’s point of view, are just normal synchronous requests. Normal interception point flows are followed.

   If a POA and a servant locator are present, the order of their operations and interception points is:

   4. the operation

   preinvoke, the operation, and postinvoke are required to execute in the same thread (see Section 11.3.7, “ServantLocator Interface,? on page 11-27). Since receive_request occurs within this chain, receive_request shall also execute in the same thread.

   postinvoke executes in the same thread as preinvoke in order for postinvoke to perform any necessary closure processing. Likewise, the sending interception points (send_reply, send_exception, or send_other) shall also execute in the same thread.

   21.3.10.3 Server-side Flow Examples

   Given the server-side flow rules, here are some concrete examples.

   For successful invocations, the chain of interception points, in order, is: receive_request_service_contexts, receive_request, send_reply -a start point is followed by an intermediate point, which is followed by an end point.

   For the following exception scenarios, assume we have Interceptors A, B, and C. On the receive interception points they are called in the order A, B, C; on the send interception points they are called in the order C, B, A.

   Scenario

   An exception is raised by the target:

   send_exception - a start point is followed by an intermediate point that is followed by an end point.

   Scenario

   B.receive_request_service_contexts raises an exception:

   In this scenario you can see that the flow for each Interceptor follows the rules:

   Scenario

   B.receive_request raises an exception:

   In this scenario you can see that the flow for each Interceptor follows the rules:

   • Since the receive_request_service_contexts starting point ran to completion then, no matter what happens in intermediate points, a “terminating? interception point must be called for all interceptors.

   Scenario

   The target invocation returns successfully, but B.send_reply raises an exception:

   In this scenario you can see that the flow for each Interceptor follows the rules:

   The scenario for B raising an exception at send_other is similar to the scenario where B raises an exception at send_reply.

   Scenario

   An exception X is raised by the target, but B.send_exception changes the exception to Y:

   In this scenario, the flow for all Interceptors is receive_request_service_contexts, receive_request, send_exception - a start point is followed by an intermediate point, which is followed by an end point; Interceptor A is handed exception Y while the B and C are handed exception X.