summaryrefslogtreecommitdiff
path: root/TAO/CIAO/docs/tutorials/CoSMIC/03.html
blob: df614e1b2bc8eb50be59fc2b7713672925867290 (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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
  <title>Building a Stock Quoter with TAO - A Tutorial</title>
<!-- $Id$ -->
</head>
<body style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"
 link="#000fff" vlink="#ff0f0f">
<h3>Implementing Quoter Components with DAnCE<br>
</h3>
We discuss this section after the PICML modeling only because we would
like to focus our attention more on the modeling stage. It does not
indicate that the implementation of components has to be
subsequent to the work we've done under GME. They are totally
orthogonal to each other. In fact, they are so orthogonal&nbsp; that we
won't go into details as to how DAnCE programming should be done. We'll
briefly go through the functionality of each component and provides the
links to their implementations respectively. For a hands on experience
on DAnCE programming, please refer to $CIAO_ROOT/DAnCE/examples/Hello. <br>
<br>
<big><big><small>Broker Component<br>
&nbsp;&nbsp;&nbsp; </small></big></big>The Broker componennt waits to
be notified by the Distributor component about stock changes. When a
stock change event arrives,&nbsp; it will go back to Distributor
component and retrieve the information it interest in and output them
to the console. The users are allowed to subscribe to the interested
stock value through the interface supported by Broker component. Here's
the complete version of <a href="../Quoter/Simple/Broker/Broker_exec.h">Broker_exec.h</a>
and <a href="../Quoter/Simple/Broker/Broker_exec.cpp">Broker_exec.cpp</a>.
<br>
<br>
<big><big><small>Distributor Component<br>
&nbsp;&nbsp; </small></big></big>The Distributor componennt monitors
the real time stock database and publishes events whenever it detects
stock change. In our program, we use a ACE_Task&nbsp; to simmulate this
real-life activity. The task will run in a seperate thread and
periodically increment the stock value by 1. In the same time the stock
value is incremented, an <span style="font-style: italic;">StockName</span>
event along with the name of the changed stock will be sent. Here's the
complete version of <a
 href="../Quoter/Simple/Distributor/Distributor_exec.h">Distributor_exec.h</a>
and <a href="../Quoter/Simple/Distributor/Distributor_exec.cpp">Distributor_exec.cpp</a><br>
<big><big><small><span style="font-style: italic;"><span
 style="font-style: italic;"></span></span><br>
Broker client<br>
&nbsp;&nbsp;&nbsp; </small></big></big>The Broker client program is
the driver program for client to control Broker component, subscribe
and unsubscribe to a specific stock. Here's the complete version of
<a href="../Quoter/Simple/Broker/Broker.cpp">Broker.cpp</a><br>
<big><big><small><br>
Distributor client<br>
&nbsp;&nbsp;&nbsp;&nbsp; </small></big></big>The Distributor client
program is the driver program for client
to control Distributor component, turn on and off the distribution
service, set up the frequency, etc. Here's the complete version of
<a href="../Quoter/Simple/Distributor/Distributor.cpp">Distributor.cpp</a><a
 name="2"><br>
<big><big><small><br>
</small></big></big></a><br>
<div style="text-align: center;"><br>
</div>
<address><a href="mailto:ming.xiong@vanderbilt.edu">Ming Xiong<br>
</a></address>
<!-- Created: Sat Nov 27 15:25:06 CST 1999 --><!-- hhmts start -->
<a href="mailto:ming.xiong@vanderbilt.edu">Last modified:<!-- hhmts end -->
</a>
</body>
</html>