blob: 62cef5a4223ab4c923f00dfbe0ed2890ccf4f541 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// $Id$
#include "orbsvcs/CosNamingC.h"
#include "orbsvcs/CosEvent/CEC_EventChannel.h"
#include "orbsvcs/CosEvent/CEC_Default_Factory.h"
#include "orbsvcs/CosEvent/CEC_Event_Loader.h"
#include "ace/Get_Opt.h"
ACE_RCSID(CosEvent_Service, CosEvent_Service, "$Id$")
int
main (int argc, char* argv[])
{
TAO_CEC_Default_Factory::init_svcs ();
ACE_DECLARE_NEW_CORBA_ENV;
ACE_TRY
{
// Intialize the ORB
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv, 0, ACE_TRY_ENV);
ACE_TRY_CHECK;
// Call TAO_CEC_Event_Loader::init (argc, argv) from here.
TAO_CEC_Event_Loader event_service;
// To intialise the service
int result =
event_service.init (argc, argv);
if (result == -1)
return 1;
// @@ Run forever... even after the EC is destroyed...
// The "Right Way"[tm] to fix this is to modify
// TAO_CEC_EventChannel to get a new option.. If the option is
// set then we destroy the ORB on EventChannel::destroy(),
// otherwise we don't.
// The option will not be set by default, but the user can pass
// it in the command line, and in this main program with set it
// to 1 by default or something like that...
// Don't worry about this change yet... Let's get all the changes
// in and then we can fix the EC shutdown problem...
orb->run (ACE_TRY_ENV);
ACE_TRY_CHECK;
// Destroy the ORB
orb->destroy(ACE_TRY_ENV);
ACE_TRY_CHECK;
}
ACE_CATCHANY
{
ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, argv[0]);
return 1;
}
ACE_ENDTRY;
return 0;
}
|