3 This test verifies that the PortableInterceptor::ForwardRequest
4 exception support is working properly. There are four cases that it
7 - PortableInterceptor::ForwardRequest exception thrown from a client
8 request interception point.
9 - PortableInterceptor::ForwardRequest exception thrown from the
10 receive_request_service_contexts() server request interception
12 - PortableInterceptor::ForwardRequest exception thrown from the
13 receive_request() server request interception point.
14 - PortableInterceptor::ForwardRequest exception thrown from the
15 send_exception() server request interception point.
17 The reason why there are two server side cases is because the
18 receive_request_service_contexts() interception point occurs before
19 the operation is dispatched to the servant. Hence, the implementation
20 of the PortableInterceptor::ForwardRequest-to-LOCATION_FORWARD GIOP
21 reply conversion in that interception point differs from the
22 conversion that occurs in interception points in servant skeletons.
24 Two servants are activated. Their corresponding references are then
25 passed to the client. The following sequence of operations then
28 1) Issue client request.
29 2) Intercept the request on the client side.
30 3) Forward the request to servant two by throwing the
31 PortableInterceptor::ForwardRequest in the
32 ClientRequestInterceptor::send_reply() interception point.
33 4) The server will receive the request.
34 5) However, it will be intercepted by the server request
36 6) The ServerRequestInterceptor::receive_request_service_contexts()
37 then forwards the client request back to servant one by throwing
38 the PortableInterceptor::ForwardRequest exception.
39 7) That exception will be converted to a LOCATION_FORWARD GIOP
41 8) The client will receive the LOCATION_FORWARD reply, and then
42 transparently forward its request to servant one.
43 9) The ServerRequestInterceptor::receive_request() interception
44 point will then throw the PortableInterceptor::ForwardRequest
45 exception to cause the request to be forwarded back to servant
47 10) The ServerRequestInterceptor::receive_request() interception
48 point then throw an OBJ_NOT_EXIST system exception which will be
49 caught in the ServerRequestInterceptor::send_exception()
50 interception point. We will then throw the
51 PortableInterceptor::ForwardRequest exception to cause the
52 request to be forwarded back to servant one again.
53 11) At this point, the request will actually be handled by servant
56 Test output should be similar to the following:
58 ==== Running PortableInterceptor::ForwardRequest test
60 ForwardRequestTest::test servant 1: <IOR:010000002000...>
61 ForwardRequestTest::test servant 2: <IOR:010000002001...>
62 CLIENT: Issuing request 1.
63 CLIENT: Request 1 handled by object 1.
64 CLIENT: Issuing request 2.
65 CLIENT (1376|1540) Request 2 will be forwarded to object 2
66 CLIENT (1376|1540) via send_request().
67 CLIENT: Request 2 handled by object 2.
68 CLIENT: Issuing request 3.
69 SERVER (1604|1276) Request 3 will be forwarded to object 1
70 SERVER (1604|1276) via receive_request_service_contexts().
71 CLIENT (1376|1540) Received LOCATION_FORWARD reply.
72 CLIENT: Request 3 handled by object 1.
73 CLIENT: Issuing request 4.
74 SERVER (1604|1276) Request 4 will be forwarded to object 2
75 SERVER (1604|1276) via receive_request().
76 CLIENT (1376|1540) Received LOCATION_FORWARD reply.
77 CLIENT: Request 4 handled by object 2.
78 CLIENT: Issuing request 5.
79 SERVER (597|3081500368) OBJ_NOT_EXIST exception thrown for request 5
80 SERVER (597|3081500368) via receive_request().
81 SERVER (597|3081500368) OBJ_NOT_EXIST exception caught for request 5
82 SERVER (597|3081500368) will be forwarded to object 1
83 SERVER (597|3081500368) via send_exception().
84 CLIENT (598|3080672976) Received LOCATION_FORWARD reply.
85 CLIENT: Request 5 handled by object 1.
86 Server is shutting down via object 1.
88 PortableInterceptor::ForwardRequest test passed.