aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cosEventDomain/doc/src/ch_event_domain_service.xml
blob: 62378cac9189ae0285a15e6f7c21137bdd7785aa (plain) (blame)
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
<?xml version="1.0" encoding="latin1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>
  <header>
    <copyright>
      <year>2001</year><year>2009</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      The contents of this file are subject to the Erlang Public License,
      Version 1.1, (the "License"); you may not use this file except in
      compliance with the License. You should have received a copy of the
      Erlang Public License along with this software. If not, it can be
      retrieved online at http://www.erlang.org/.
    
      Software distributed under the License is distributed on an "AS IS"
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
      the License for the specific language governing rights and limitations
      under the License.
    
    </legalnotice>

    <title>Event Domain Service</title>
    <prepared>Niclas Eklund</prepared>
    <docno></docno>
    <date>2001-08-20</date>
    <rev>A</rev>
    <file>ch_event_domain_service.xml</file>
  </header>

  <section>
    <title>Overview of the CosEventDomain Service</title>
    <p>The Event Domain service allows programmers to manage a cluster
      of information channels.</p>

    <section>
      <title>Event Domain Service Components</title>
      <p>There are two components in the OMG CosEventDomainAdmin service architecture:</p>
      <list type="bulleted">
        <item><em>EventDomainFactory:</em> a factory for creating EventDomains.</item>
        <item><em>EventDomain:</em> supplies a tool, which makes it easy to create
         topologies of interconnected channels (i.e. a directed graph).</item>
      </list>
    </section>

    <section>
      <title>A Tutorial on How to Create a Simple Service</title>
      <p>To be able to use the cosEventDomain application, the cosNotification
        and, possibly, the cosTime application must be installed.</p>
    </section>

    <section>
      <title>How to Run Everything</title>
      <p>Below is a short transcript on how to run cosEventDomain. </p>
      <code type="none"><![CDATA[
 
%% 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, 
\011\011\011\011       consumer_id=ID2,
\011\011\011\011       ctype='STRUCTURED_EVENT',
\011\011\011\011       notification_style='Pull'},

%% Connect them:
'CosEventDomainAdmin_EventDomain':add_connection(ED, C1),
      ]]></code>
    </section>
  </section>
</chapter>