3 //=============================================================================
5 * @file Consumer_Signal_Handler.cpp
7 * Implementation of the Consumer_Signal_Handler class.
9 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
11 //=============================================================================
13 #include "Consumer_Signal_Handler.h"
15 Consumer_Signal_Handler::Consumer_Signal_Handler (Consumer_Handler
*consumer_handler
)
16 : consumer_handler_ (consumer_handler
)
20 // Method to handle the ^C signal.
22 Consumer_Signal_Handler::handle_signal (int /* signum */,
26 ACE_DEBUG ((LM_DEBUG
, " Exiting on receiving ^C\n"));
33 // Method called before the Event_Handler dies.
35 Consumer_Signal_Handler::handle_close (ACE_HANDLE
, ACE_Reactor_Mask
)
37 // End of the signal handler.
44 Consumer_Signal_Handler::quit_on_signal ()
46 // Only if the consumer is registered and wants to shut down, its
47 // necessary to unregister and then shutdown.
50 if (consumer_handler_
->unregistered_
!= 1
51 && consumer_handler_
->registered_
== 1)
53 this->consumer_handler_
->server_
->unregister_callback
54 (this->consumer_handler_
->consumer_var_
.in ());
56 "Consumer Unregistered\n"));
58 this->consumer_handler_
->consumer_servant_
->shutdown ();
60 catch (const CORBA::Exception
& ex
)
62 ex
._tao_print_exception (
63 "Consumer_Input_Handler::quit_consumer_process()");