3 //=============================================================================
5 * @file Consumer_Signal_Handler.cpp
7 * Implementation of the Consumer_Signal_Handler class.
9 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
11 //=============================================================================
14 #include "Consumer_Signal_Handler.h"
16 Consumer_Signal_Handler::Consumer_Signal_Handler (Consumer_Handler
*consumer_handler
)
17 : consumer_handler_ (consumer_handler
)
21 Consumer_Signal_Handler:: ~Consumer_Signal_Handler (void)
25 // Method to handle the ^C signal.
27 Consumer_Signal_Handler::handle_signal (int /* signum */,
32 " Exiting on receiving ^C\n"));
39 // Method called before the Event_Handler dies.
41 Consumer_Signal_Handler::handle_close (ACE_HANDLE
,
44 // End of the signal handler.
51 Consumer_Signal_Handler::quit_on_signal (void)
53 // Only if the consumer is registered and wants to shut down, its
54 // necessary to unregister and then shutdown.
59 if (consumer_handler_
->unregistered_
!= 1
60 && consumer_handler_
->registered_
== 1)
62 this->consumer_handler_
->server_
->unregister_callback
63 (this->consumer_handler_
->consumer_var_
.in ());
65 "Consumer Unregistered\n"));
67 this->consumer_handler_
->consumer_servant_
->shutdown ();
69 catch (const CORBA::Exception
& ex
)
71 ex
._tao_print_exception (
72 "Consumer_Input_Handler::quit_consumer_process()");