[omniNotify] resolving Notification Service
Andy Goetz
goetz@esrf.fr
Thu Jan 30 08:49:02 2003
Hi,
I am new to omniNotify so please be patient if my question has an obvious
answer.
I am trying to get a VERY simple example working with a server and client
for omniNotify building them from scratch. I have hacked the examples code
to send my own events but I do not find it very clear. I would like to
write a server and client from scratch using the COS Notification API
directly. My first example fails just trying to get the
EventChannelFactory.
My code to get a handle on the EventChannelFactory looks like this :
CosNotifyChannelAdmin::EventChannel_var eventChannelFactory;
try
{
CORBA::Object_var obj =
orb -> resolve_initial_references("NotificationService");
//
// Narrow the CORBA_Object reference to an EventChannelFactory
// reference so we can invoke its methods
//
eventChannelFactory =
CosNotifyChannelAdmin::EventChannelFactory::_narrow(obj);
}
catch(...)
{
cerr << "Cannot resolve `NotificationService'" << endl;
exit(1);
}
//
// Make sure the CORBA object was really an EventChannelFactory
//
if(CORBA::is_nil(eventChannelFactory))
{
cerr << "`NotificationService' initial reference is not "
<< "a CosNotifyChannelAdmin::EventChannelFactory"
<< endl;
exit(1);
}
But it never resolves the EventChannelFactory. I have tried resolving the
IOR in the /tmp/rdifact.ior file as well but when I do the narrow it says
this is not an EventChannelFactory.
My questions are :
(1) is the bootstrap method via "NotificationService" supported ?
(2) why can I not narrow /tmp/rdifact.ior to
CosNotifyChannelAdmin::EventChannelFactory ?
Thanks for any help you can give on this.
Andy Gotz
--
European Synchrotron Radiation Facility
6, rue Jules Horowitz,
Grenoble, 38043
FRANCE
tel: (+33)-476882646
email: goetz@esrf.fr
andy_gotz@yahoo.fr