3 //=============================================================================
5 * @file Consumer_Handler.h
7 * Subclass of Corba_Handler that sets up the Consumer handler
8 * for use with the ACE ACE_Reactor.
10 * @author Douglas C. Schmidt (d.schmidt@vanderbilt.edu) and Pradeep Gore (pradeep@cs.wustl.edu)
12 //=============================================================================
15 #ifndef _CONSUMER_HANDLER_H
16 #define _CONSUMER_HANDLER_H
18 #include "Event_Comm_i.h"
19 #include "orbsvcs/Naming/Naming_Client.h"
20 #include "orbsvcs/CosNamingC.h"
23 * @class Consumer_Handler
25 * @brief The Consumer_Handler class.
27 * Starts up the ORB, registers the <Event_Comm::Consumer>
28 * servant with the orb and gets a reference to a <Notifier>
29 * from the Naming Service.
31 class Consumer_Handler
35 Consumer_Handler (void);
38 virtual ~Consumer_Handler (void);
40 /// Initializes the ORB, gets the Notifier reference from the Naming
41 /// Service, and starts the servant for the Consumer object.
42 int init (int argc
, ACE_TCHAR
*argv
[], ShutdownCallback
*_shutdowncallback
);
50 /// called to shutdown the consumer application.
54 Event_Comm::Consumer
*receiver (void);
55 Event_Comm::Notifier
*notifier (void);
57 /// returns the ORB's reactor.
58 ACE_Reactor
*reactor (void);
61 /// gets the notifier reference from the naming service.
62 /// returns 0 on success, -1 on error.
63 int get_notifier (void);
68 /// The <Consumer> implementation.
69 Consumer_i receiver_i_
;
71 /// Pointer to an IDL <Consumer> proxy object.
72 Event_Comm::Consumer_var receiver_
;
74 /// Pointer to an IDL <Notifier> proxy object.
75 Event_Comm::Notifier_var notifier_
;
77 /// An instance of the name client used for resolving the factory
79 TAO_Naming_Client naming_services_client_
;
81 /// The Shutdown callback used to shutdown the consumer application.
82 ShutdownCallback
* shutdowncallback
;
85 #define NOTIFIER_BIND_NAME "Notifier"
87 #endif /* _CONSUMER_HANDLER_H */