<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../../../../doc/otp_doc.css" type="text/css"> <title>Erlang -- Event Domain Service</title> </head> <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container"> <script id="js" type="text/javascript" language="JavaScript" src="../../../../doc/js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../../../../doc/js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript"> <!-- function getWinHeight() { var myHeight = 0; if( typeof( window.innerHeight ) == 'number' ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } return myHeight; } function setscrollpos() { var objf=document.getElementById('loadscrollpos'); document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2; } function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', setscrollpos); //--></script><div id="leftnav"><div class="innertube"> <img alt="Erlang logo" src="../../../../doc/erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="index.html">Reference Manual</a><br><a href="release_notes.html">Release Notes</a><br><a href="../pdf/cosEventDomain-1.1.12.pdf">PDF</a><br><a href="../../../../doc/index.html">Top</a></small><p><strong>cosEventDomain</strong><br><strong>User's Guide</strong><br><small>Version 1.1.12</small></p> <br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Chapters</strong></small></p> <ul class="flipMenu" imagepath="../../../../doc/js/flipmenu"> <li id="no" title="The cosEventDomain Application" expanded="false">The cosEventDomain Application<ul> <li><a href="ch_contents.html"> Top of chapter </a></li> <li title="Content Overview"><a href="ch_contents.html#id61517">Content Overview</a></li> <li title="Brief Description of the User's Guide"><a href="ch_contents.html#id57476">Brief Description of the User's Guide</a></li> </ul> </li> <li id="no" title="Introduction to cosEventDomain" expanded="false">Introduction to cosEventDomain<ul> <li><a href="ch_introduction.html"> Top of chapter </a></li> <li title="Overview"><a href="ch_introduction.html#id60763">Overview</a></li> </ul> </li> <li id="no" title="Quality Of Service and Admin Properties" expanded="false">Quality Of Service and Admin Properties<ul> <li><a href="ch_QoS.html"> Top of chapter </a></li> <li title="Quality Of Service and Admin Properties"><a href="ch_QoS.html#id60742">Quality Of Service and Admin Properties</a></li> </ul> </li> <li id="loadscrollpos" title="Event Domain Service" expanded="true">Event Domain Service<ul> <li><a href="ch_event_domain_service.html"> Top of chapter </a></li> <li title="Overview of the CosEventDomain Service"><a href="ch_event_domain_service.html#id58251">Overview of the CosEventDomain Service</a></li> </ul> </li> </ul> </div></div> <div id="content"> <div class="innertube"> <h1>4 Event Domain Service</h1> <h3><a name="id58251">4.1 Overview of the CosEventDomain Service</a></h3> <p>The Event Domain service allows programmers to manage a cluster of information channels.</p> <h4>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> <h4>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> <h4>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> </div> <div class="footer"> <hr> <p>Copyright © 2001-2012 Ericsson AB. All Rights Reserved.</p> </div> </div> </div></body> </html>