3 // ============================================================================
5 * @file Event_Consumer.h
7 * An example of using the Event_Logging_Service.
8 * The Event_Consumer consumes log-generated events.
10 * @author D A Hanvey (d.hanvey@qub.ac.uk)
12 // ============================================================================
14 #ifndef EVENT_CONSUMER_H
15 #define EVENT_CONSUMER_H
17 #include "orbsvcs/DsEventLogAdminC.h"
18 #include "orbsvcs/CosEventCommS.h"
19 #include "orbsvcs/CosNamingC.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 class Consumer
: public POA_CosEventComm::PushConsumer
28 // Simple consumer object
31 // This class is a consumer of log generated events.
37 int run (int argc
, ACE_TCHAR
* argv
[]);
40 // = The CosEventComm::PushConsumer methods
42 virtual void push (const CORBA::Any
&event
);
44 virtual void disconnect_push_consumer (void);
45 // The skeleton methods.
50 CORBA::ULong event_count_
;
51 // Keep track of the number of events received.
54 // The orb, just a pointer because the ORB does not outlive the
57 CosNaming::NamingContext_var naming_context_
;
58 // Handle to the name service.
60 DsEventLogAdmin::EventLogFactory_var event_log_factory_
;
61 // The Event Log Factory that generates the events to be consumed.
63 CosEventChannelAdmin::ProxyPushSupplier_var supplier_
;
64 // The proxy that we are connected to.
68 #endif /* EVENT_CONSUMER_H */