1 #include "orbsvcs/Log_Macros.h"
2 #include "Notify_Service.h"
3 #include "orbsvcs/orbsvcs/Notify/Properties.h"
5 // Must include this file to get a static initializer
6 #include "tao/Valuetype/Valuetype_Adapter_Impl.h"
8 #include "ace/OS_main.h"
10 #include "orbsvcs/Shutdown_Utilities.h"
11 #include "tao/debug.h"
14 class Notify_Service_Shutdown_Functor
15 : public Shutdown_Functor
18 Notify_Service_Shutdown_Functor (TAO_Notify_Service_Driver
& svc
);
20 void operator() (int which_signal
);
23 TAO_Notify_Service_Driver
& svc_
;
26 Notify_Service_Shutdown_Functor::Notify_Service_Shutdown_Functor (TAO_Notify_Service_Driver
& svc
)
32 Notify_Service_Shutdown_Functor::operator() (int which_signal
)
34 if (TAO_debug_level
> 0)
35 ORBSVCS_DEBUG ((LM_DEBUG
,
36 "shutting down on signal %d\n", which_signal
));
37 (void) this->svc_
.fini ();
40 // Driver function for the TAO Notify Service.
43 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
45 TAO_Notify_Service_Driver notify_service
;
47 Notify_Service_Shutdown_Functor
killer (notify_service
);
48 Service_Shutdown
kill_contractor (killer
);
52 if (notify_service
.init (argc
, argv
) == -1)
53 ORBSVCS_ERROR_RETURN ((LM_ERROR
,
54 ACE_TEXT("Failed to initialize the Notification Service.\n")),
57 notify_service
.run ();
59 catch (const CORBA::Exception
& ex
)
61 ex
._tao_print_exception (
62 ACE_TEXT ("Failed to run the Notification Service\n"));