1 #include "orbsvcs/CosNamingC.h"
2 #include "orbsvcs/Daemon_Utilities.h"
3 #include "orbsvcs/CosEvent/CEC_EventChannel.h"
4 #include "orbsvcs/CosEvent/CEC_Default_Factory.h"
5 #include "orbsvcs/CosEvent/CEC_Event_Loader.h"
6 #include "ace/Get_Opt.h"
7 #include "ace/Argv_Type_Converter.h"
8 #include "ace/OS_main.h"
11 ACE_TMAIN (int argc
, ACE_TCHAR
* argv
[])
13 TAO_CEC_Default_Factory::init_svcs ();
17 // Check if -ORBDaemon is specified and if so, daemonize at this moment,
18 // -ORBDaemon in the ORB core is faulty, see bugzilla 3335
19 TAO_Daemon_Utility::check_for_daemon (argc
, argv
);
21 // Copy command line parameter.
22 ACE_Argv_Type_Converter
command_line(argc
, argv
);
26 CORBA::ORB_init (command_line
.get_argc(), command_line
.get_TCHAR_argv());
28 // Call TAO_CEC_Event_Loader::init (argc, argv) from here.
29 TAO_CEC_Event_Loader event_service
;
31 // To intialise the service
33 event_service
.init (command_line
.get_argc(), command_line
.get_TCHAR_argv());
38 // @@ Run forever... even after the EC is destroyed...
39 // The "Right Way"[tm] to fix this is to modify
40 // TAO_CEC_EventChannel to get a new option.. If the option is
41 // set then we destroy the ORB on EventChannel::destroy(),
42 // otherwise we don't.
43 // The option will not be set by default, but the user can pass
44 // it in the command line, and in this main program with set it
45 // to 1 by default or something like that...
46 // Don't worry about this change yet... Let's get all the changes
47 // in and then we can fix the EC shutdown problem...
49 // As inidicated above, The Typed EC implementation can now be
50 // destroyed by passing -d at the command line and
51 // calling destroy on the typed EC interface.
52 // Calling fini() completes the destruction, although most of
53 // this is done in TAO_CEC_TypedEventChannel::shutdown().
56 #if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
58 #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */
63 catch (const CORBA::Exception
& ex
)
65 ex
._tao_print_exception (argv
[0]);