=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / docs / notification / using_monitor_extensions.html
blob5e16061ce480b9b069a3301f680b7c119ed53dd2
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html>
3 <head>
4 <title>Using the CosNotification Monitoring Extensions</title>
5 <!-- -->
6 </head>
7 <body>
8 <h2>Using the NotifyMonitoringExt::EventChannelFactory.</h2>
9 <p>
10 Obtain the CosNotification Service EventChannelFactory from the Name Service
11 as you normally would. Instead of narrowing it to a
12 <b>CosNotifyChannelAdmin::EventChannelFactory</b>, narrow it to a
13 <b>NotifyMonitoringExt::EventChannelFactory</b>.
14 </p>
15 <pre>
16 CosNaming::Name name(1);
17 name.length(1);
18 name[0].id = CORBA::string_dup("NotifyEventChannelFactory");
20 CORBA::Object_var obj = naming_context->resolve(name);
22 NotifyMonitoringExt::EventChannelFactory_var notify_factory =
23 NotifyMonitoringExt::EventChannelFactory::_narrow(obj.in());
24 </pre>
25 <p>
26 You can then create named event channels using the
27 <b>create_named_channel</b> method.
28 </p>
29 <pre>
30 CosNotification::QoSProperties initial_qos;
31 CosNotification::AdminProperties initial_admin;
32 CosNotifyChannelAdmin::ChannelID id;
34 CosNotifyChannelAdmin::EventChannel_var ec =
35 notify_factory->create_named_channel(initial_qos,
36 initial_admin,
37 id,
38 "Name of Event Channel");
39 </pre>
40 <h2>Using the NotifyMonitoringExt::ConsumerAdmin.</h2>
41 <p>
42 Obtain the <b>NotifyMonitoringExt::ConsumerAdmin</b> as you would the
43 <b>CosNotifyChannelAdmin::ConsumerAdmin</b>. However, it must then be
44 narrowed to a <b>NotifyMonitoringExt::ConsumerAdmin</b>.
45 </p>
46 <pre>
47 CosNotifyChannelAdmin::AdminID admin_id;
49 CosNotifyChannelAdmin::ConsumerAdmin_var admin =
50 ec->new_for_consumers(CosNotifyChannelAdmin::OR_OP, admin_id);
52 NotifyMonitoringExt::ConsumerAdmin_var madmin =
53 NotifyMonitoringExt::ConsumerAdmin::_narrow(admin.in());
54 </pre>
55 <p>
56 It is also possible to create named ConsumerAdmin objects using the
57 following.
58 </p>
59 <pre>
60 CosNotifyChannelAdmin::AdminID admin_id;
62 CosNotifyChannelAdmin::ConsumerAdmin_var admin =
63 ec->named_new_for_consumers(CosNotifyChannelAdmin::OR_OP, admin_id,
64 "ConsumerAdmin Name");
66 NotifyMonitoringExt::ConsumerAdmin_var madmin =
67 NotifyMonitoringExt::ConsumerAdmin::_narrow(admin.in());
68 </pre>
69 <p>
70 Once you have a <b>NotifyMonitoringExt::ConsumerAdmin</b> you can then
71 create a named proxy push supplier:
72 </p>
73 <pre>
74 CosNotifyChannelAdmin::ProxyID proxy_id;
76 CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
77 admin->obtain_named_notification_push_supplier (
78 CosNotifyChannelAdmin::STRUCTURED_EVENT,
79 proxy_id,
80 "Consumer Name");
81 </pre>
82 <h2>Using the NotifyMonitoringExt::SupplierAdmin.</h2>
83 <p>
84 Obtain the <b>NotifyMonitoringExt::SupplierAdmin</b> as you would the
85 <b>CosNotifyChannelAdmin::SupplierAdmin</b>. However, it must then be
86 narrowed to a <b>NotifyMonitoringExt::SupplierAdmin</b>.
87 </p>
88 <pre>
89 CosNotifyChannelAdmin::AdminID admin_id;
91 CosNotifyChannelAdmin::SupplierAdmin_var admin =
92 ec->new_for_suppliers(CosNotifyChannelAdmin::AND_OP, admin_id);
94 NotifyMonitoringExt::SupplierAdmin_var madmin =
95 NotifyMonitoringExt::SupplierAdmin::_narrow(admin.in());
96 </pre>
97 <p>
98 It is also possible to create named ConsumerAdmin objects using the
99 following.
100 </p>
101 <pre>
102 CosNotifyChannelAdmin::AdminID admin_id;
104 CosNotifyChannelAdmin::SupplierAdmin_var admin =
105 ec->named_new_for_suppliers(CosNotifyChannelAdmin::AND_OP, admin_id,
106 "SupplierAdmin Name");
108 NotifyMonitoringExt::SupplierAdmin_var madmin =
109 NotifyMonitoringExt::SupplierAdmin::_narrow(admin.in());
110 </pre>
112 Once you have a <b>NotifyMonitoringExt::SupplierAdmin</b> you can then
113 create a named proxy push consumer:
114 </p>
115 <pre>
116 CosNotifyChannelAdmin::ProxyID proxy_id;
118 CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
119 admin->obtain_named_notification_push_consumer (
120 CosNotifyChannelAdmin::STRUCTURED_EVENT,
121 proxy_id,
122 "Supplier Name");
123 </pre>
124 <h2>Effects of using these interfaces</h2>
126 Using these extended interfaces allows users to link descriptive names
127 to various objects held within the CosNotification Service. Assuming
128 that the Notify_Service has been configured to enable the monitoring
129 capabilities, these objects would normally be given names that are
130 equivalent to their id upon activation.
131 </p>
132 <font size=-1>See also the <a href="monitor.html">Notification Service
133 Monitor</a> documentation.</font>
134 </body>
135 </html>