1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
4 <title>Using the CosNotification Monitoring Extensions
</title>
8 <h2>Using the NotifyMonitoringExt::EventChannelFactory.
</h2>
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>.
16 CosNaming::Name name(
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());
26 You can then create named event channels using the
27 <b>create_named_channel
</b> method.
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,
38 "Name of Event Channel");
40 <h2>Using the NotifyMonitoringExt::ConsumerAdmin.
</h2>
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>.
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());
56 It is also possible to create named ConsumerAdmin objects using the
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());
70 Once you have a
<b>NotifyMonitoringExt::ConsumerAdmin
</b> you can then
71 create a named proxy push supplier:
74 CosNotifyChannelAdmin::ProxyID proxy_id;
76 CosNotifyChannelAdmin::ProxySupplier_var proxy_supplier =
77 admin-
>obtain_named_notification_push_supplier (
78 CosNotifyChannelAdmin::STRUCTURED_EVENT,
82 <h2>Using the NotifyMonitoringExt::SupplierAdmin.
</h2>
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>.
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());
98 It is also possible to create named ConsumerAdmin objects using the
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());
112 Once you have a
<b>NotifyMonitoringExt::SupplierAdmin
</b> you can then
113 create a named proxy push consumer:
116 CosNotifyChannelAdmin::ProxyID proxy_id;
118 CosNotifyChannelAdmin::ProxyConsumer_var proxy_consumer =
119 admin-
>obtain_named_notification_push_consumer (
120 CosNotifyChannelAdmin::STRUCTURED_EVENT,
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.
132 <font size=-
1>See also the
<a href=
"monitor.html">Notification Service
133 Monitor
</a> documentation.
</font>