3 // ============================================================================
5 * @file Event_Service.h
7 * The TAO event service implementation.
9 #ifndef EC_EVENT_SERVICE_H
10 #define EC_EVENT_SERVICE_H
11 #include /**/ "ace/pre.h"
13 #include "orbsvcs/RtecEventChannelAdminS.h"
15 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "orbsvcs/RtecSchedulerS.h"
19 #include "ace/SString.h"
22 * @class Event_Service
24 * This class decorates an Event Channel implementation, but in a very simple
25 * way: destroy() also shutdowns the ORB.
27 * The Event_Channel implementations should not shutdown the ORB by default,
28 * but in this case, where the Event_Channel is (almost) the only service on
29 * the host, it makes more sense to do so.
31 class Event_Service
: public POA_RtecEventChannelAdmin::EventChannel
35 virtual ~Event_Service ();
37 /// Run the event service.
38 int run (int argc
, ACE_TCHAR
* argv
[]);
40 // = The RtecEventChannelAdmin::Event_Channel methods
41 virtual RtecEventChannelAdmin::ConsumerAdmin_ptr
43 virtual RtecEventChannelAdmin::SupplierAdmin_ptr
45 virtual void destroy ();
46 virtual RtecEventChannelAdmin::Observer_Handle
47 append_observer (RtecEventChannelAdmin::Observer_ptr observer
);
48 virtual void remove_observer (RtecEventChannelAdmin::Observer_Handle
);
51 /// Parse the command line args
52 int parse_args (int argc
, ACE_TCHAR
* argv
[]);
54 enum Sched_type_t
{ES_SCHED_NONE
, ES_SCHED_GLOBAL
, ES_SCHED_LOCAL
};
57 /// The Scheduler implementation.
58 POA_RtecScheduler::Scheduler
*sched_impl_
;
60 /// The Event Channel implementation.
61 POA_RtecEventChannelAdmin::EventChannel
*ec_impl_
;
63 /// The name we use to bind with the NameService
64 ACE_CString service_name_
;
66 /// The name of the file were we output the Event_Service IOR.
67 ACE_TString ior_file_name_
;
69 /// The name of a file where the process stores its pid
70 ACE_TString pid_file_name_
;
72 /// The name of the servant we use when we use persistent IORs
73 ACE_CString object_id_
;
75 /// Should we use a global scheduler or a local one or none?
76 Sched_type_t scheduler_type_
;
78 /// A reference to the ORB, to shut it down properly.
81 /// Use BiDirectional GIOP
84 /// Should we bind to the naming service
85 bool bind_to_naming_service_
;
88 #include /**/ "ace/post.h"
89 #endif /* EC_EVENT_SERVICE_H */