Download O2Notification User Manual

Transcript
Initialization
2.3 Initialization
Initialization of emitters
A clien t wh ich wan t s t o h ave a n am e associat ed t o t h e even ts it n ot ifies,
eit h er explicit ly or im plicit ly, m u st r egist er it s sym bolic n am e wit h t h e
n ot ificat ion ser vice. Th is m ay be u sefu l, for exam ple, for n ot ifyin g ot h er
clien t s at con n ect tim e, so t h at t h ey m ay n ow be n ot ified of som e
specific even t s em it t ed by t h e con n ectin g clien t .
Th is can be don e by t h e con st r u ct or of t h e n ot ificat ion ser ver or by
callin g t h e followin g m et h od:
void o2_Notification::register_client_name (char * clientName);
An y fu r t h er r egist r at ion of a n am e can cels t h e pr eviou s on e. Th e
r egist r at ion of n am es is n ot n ot ified by t h e syst em . If t h e applicat ion
wan t s t o n otify n am e ch an ges, it m u st defin e an d n ot ify t h e associat ed
u ser even t .
Sever al clien t s m ay r egist er th e sam e n am e with t h e n ot ificat ion ser ver .
Th e n am e r egist r at ion m u st be don e befor e a con n ection t o O2 ,
oth er wise it is n ot tak en in t o accou n t .
Initialization of recipients
A clien t t h at wan ts t o r eceive n ot ificat ion s m ay r et r ieve t h e n ot ificat ion
qu eu e fr om t h e n ot ificat ion ser ver .
Th e qu eu e t h at will r eceive t h e n ot ificat ion m essages m u st be explicit ly
polled by t h e r ecipien t . It s in t er face is descr ibed in sect ion 5.2. It is
r et r ieved by callin g t h e followin g m eth od of t h e n ot ificat ion ser ver :
class o2_Notification_Queue;
o2_Notification_Queue * o2_Notification::get_queue ( );
O2 Not ificat ion User Man u al
21