File: ch_event_domain_service.html

package info (click to toggle)
erlang-doc-html 1%3A12.b.3-dfsg-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 27,712 kB
  • ctags: 13,052
  • sloc: erlang: 505; ansic: 323; perl: 61; makefile: 57; sh: 23
file content (152 lines) | stat: -rw-r--r-- 4,607 bytes parent folder | download
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This document was generated using DocBuilder-0.9.8.4 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Event Domain Service</title>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
  <script type="text/javascript" src="../../../../doc/erlresolvelinks.js"></script>
  <style type="text/css">
<!--
    body          { font-family: Verdana, Arial, Helvetica, sans-serif }
    span.bold_code        { font-family: courier;font-weight: bold}
    span.code        { font-family: courier;font-weight: normal}

.note, .warning {
  border: solid black 1px;
  margin: 1em 3em;
}

.note .label {
  background: #30d42a;
  color: white;
  font-weight: bold;
  padding: 5px 10px;
}
.note .content {
  background: #eafeea;
  color: black;
  line-height: 120%;
  font-size: 90%;
  padding: 5px 10px;
}
.warning .label {
  background: #C00;
  color: white;
  font-weight: bold;
  padding: 5px 10px;
}
.warning .content {
  background: #FFF0F0;
  color: black;
  line-height: 120%;
  font-size: 90%;
  padding: 5px 10px;
}

    .example     { background-color:#eeeeff } 
    pre          { font-family: courier; font-weight: normal }
    .REFBODY     { margin-left: 13mm }
    .REFTYPES    { margin-left: 8mm }
-->
  </style>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#FF00FF" alink="#FF0000">
<center>
<a href="http://www.ericsson.com/technology/opensource/erlang"><img border="0" alt="[Ericsson AB]" src="min_head.gif"/></a>
</center><a name="4"><!-- Empty --></a>
<h2>4 Event Domain Service</h2>
<a name="4.1"><!-- Empty --></a>
<h3>4.1 Overview of the CosEventDomain Service</h3>

<p>The Event Domain service allows programmers to manage a cluster
of information channels.
</p><a name="4.1.1"><!-- Empty --></a>
<h4>4.1.1 Event Domain Service Components</h4>

<p>There are two components in the OMG CosEventDomainAdmin service architecture:
</p>
<ul>

<li>
<strong>EventDomainFactory:</strong> a factory for creating EventDomains.
</li>


<li>
<strong>EventDomain:</strong> supplies a tool, which makes it easy to create
topologies of interconnected channels (i.e. a directed graph).
</li>


</ul>
<a name="4.1.2"><!-- Empty --></a>
<h4>4.1.2 A Tutorial on How to Create a Simple Service</h4>

<p>To be able to use the cosEventDomain application, the cosNotification
and, possibly, the cosTime application must be installed.
</p><a name="4.1.3"><!-- Empty --></a>
<h4>4.1.3 How to Run Everything</h4>

<p>Below is a short transcript on how to run cosEventDomain. 
</p>
<div class="example"><pre>
 
%% Start Mnesia and Orber
mnesia:delete_schema([node()]),
mnesia:create_schema([node()]),
orber:install([node()]),
mnesia:start(),
orber:start(),
 
%% Install and start cosNotification.
cosNotificationApp:install(),
cosNotificationApp:start(),

%% Install and start cosEventDomain.
cosEventDomainApp:install(),
cosEventDomainApp:start(),

%% Start a CosEventDomainAdmin factory.
AdminFac = cosEventDomainApp:start_factory(),

%% Define the desired QoS settings:
QoS = 
   [#'CosNotification_Property'
    {name='CosEventDomainAdmin':'DiamondDetection'(), 
     value=any:create(orber_tc:short(),
     'CosEventDomainAdmin':'AuthorizeDiamonds'())},
    #'CosNotification_Property'
    {name='CosEventDomainAdmin':'CycleDetection'(), 
     value=any:create(orber_tc:short(),
     'CosEventDomainAdmin':'ForbidCycles'())}],

%% Create a new EventDomain:
{ED, EDId} = 'CosEventDomainAdmin_EventDomainFactory':
                        create_event_domain(Fac, QoS, []),

%% Now we can add Notification Channels to the Domain. How this
%% is done, see the cosNotification documentation. Let us assume
%% that we have gained access to two Channel Objects; add them to the
%% domain:
ID1 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch1),
ID2 = 'CosEventDomainAdmin_EventDomain':add_channel(ED, Ch2),

%% To connect them, we must first define a connection struct:
C1 = #'CosEventDomainAdmin_Connection'{supplier_id=ID1, 
                                       consumer_id=ID2,
                                       ctype='STRUCTURED_EVENT',
                                       notification_style='Pull'},

%% Connect them:
'CosEventDomainAdmin_EventDomain':add_connection(ED, C1),
      
</pre></div>
<center>
<hr/>
<small>cosEventDomain 1.1.3<br/>
  Copyright &copy; 1991-2008
  <a href="http://www.ericsson.com/technology/opensource/erlang">Ericsson AB</a><br/>
</small>
</center></body>
</html>