3 //=============================================================================
5 * @file Consumer_Signal_Handler.h
7 * Definition of the Consumer_Signal_Handler class.
9 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
11 //=============================================================================
14 #ifndef CONSUMER_SIGNAL_HANDLER_H
15 #define CONSUMER_SIGNAL_HANDLER_H
17 #include "ace/Reactor.h"
18 #include "ace/Event_Handler.h"
19 #include "Consumer_Handler.h"
21 class Consumer_Handler
;
24 * @class Consumer_Signal_Handler
26 * @brief Creating a class to handle signal events.
28 * Since only signals need to be handled, only the <handle_signal> method
31 class Consumer_Signal_Handler
: public ACE_Event_Handler
35 /// The consumer_handler refernce will be used to access the servant
37 Consumer_Signal_Handler (Consumer_Handler
*consumer_handler
);
39 /// This method takes action on an signal event.
40 int handle_signal (int signum
,
45 * For removal of the signal handler from the dispatch tables. When
46 * the handle_signal () returns < 0 this method will be executed
49 int handle_close (ACE_HANDLE handle
,
50 ACE_Reactor_Mask close_mask
);
53 /// Protected destructor so that the signal handler is always created
54 /// dynamically and hence the heap doesnt get corrupted.
55 ~Consumer_Signal_Handler (void);
58 /// Exit gracefully on a signal.
59 int quit_on_signal (void);
61 /// Reference to the Consumer_Handler which is used in accessing the
63 Consumer_Handler
*consumer_handler_
;
66 #endif /* CONSUMER_SIGNAL_HANDLER_H */