blob: 7f464d09f25adcad4f443cb55b671845ce683da3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
Smart Proxies Overview
----------------------
Smart Proxies are a TAO extension that helps applications create
user-defined proxies that can be used to add custom client-side
processing and security to the default stub proxy.
For details on how TAO implements Smart Proxies please see:
www.cs.wustl.edu/~schmidt/ACE_wrappers/TAO/docs/Smart_Proxies.html
Smart Proxy Example
-------------------
This directory contains a simple example that demostrats how the TAO
Smart Proxy feature can be used. In this example, just a single
method has been "smartified" to illustrate how you just implement the
methods you wish to customize since the rest will be taken care of the
genearated Smart Proxy base class.
All you need to define in the client application is a new factory that
will produce the kind of proxy desired by the user. This factory must
be provided by the user and must derive from the generated
TAO_Default_Proxy_Factory class.
This test particularly is used to test out the different policies for the
smart proxy. If the same smart proxy is needed for the interface the
"one-shot" policy is to be used by which once a smart proxy factory is
registered it is retained until the program terminates. This is the default
behavior. But if a more flexible option is desired where the smart proxy
can be different with every instance of the target object, then the
one-shot plolicy has to be disabled by passing a 0 at creation time.
For execution of the test:
1) ./server -o test1.ior
2) ./server -o test2.ior
2) ./client
The -f0 option tries out the "per-object" policy and the -f1 (default)
tries out the "one-shot" aka "per-interface" policy.
or simply use:
run_test.pl
Happy troubleshooting!
===============EXPECTED OUTPUT==========================
running Smart Proxy test consisting of the client and two servers with <one-shot> policy
Smart_Test_Factory
create_smart_proxy
Yahoo, I am smart
Test_i::method () invoked
event loop finished
create_smart_proxy
Yahoo, I am smart
Test_i::method () invoked
event loop finished
running Smart Proxy test consisting of the client and two servers with <one-shot> policy disabled
Smart_Test_Factory
create_smart_proxy
Yahoo, I am smart
Test_i::method () invoked
event loop finished
Test_i::method () invoked
event loop finished
===========================================================================================
Note: Difference in output of first two cases:
"Yahoo, I am smart" signifies that the smart proxy is being called. In the first case,
it is seen twice demostrating that with both servers the same kind of smart proxy was
used since the smart proxy factory was permanent in behavior or "one-shot".
While in send portion of the output, the smart proxy is used only once, that is in the
first time around and the default proxy is called upon the second time. This is because
the smart proxy factory gets unregistered since the "one-shot" policy is disabled.
For details, please see: http://www.cs.wustl.edu/~schmidt/PDF/COOTS-00.pdf
|