summaryrefslogtreecommitdiff
path: root/ace/Service_Manager.h
blob: c35b207e759636ba73838f736c4b767ccaf12b46 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* -*- C++ -*- */
// $Id$


// ============================================================================
//
// = LIBRARY
//    ace
// 
// = FILENAME
//    Service_Manager.h
//
// = AUTHOR
//    Doug Schmidt 
// 
// ============================================================================

#if !defined (ACE_SERVICE_MANAGER_H)
#define ACE_SERVICE_MANAGER_H

#include "ace/SOCK_Stream.h"
#include "ace/SOCK_Acceptor.h"
#include "ace/INET_Addr.h"
#include "ace/Service_Object.h"

class ACE_Export ACE_Service_Manager : public ACE_Service_Object
  // = TITLE
  //     Provide a standard service that returns a list of all services in the
  //  Service Repository. 
  //
  // = DESCRIPTION
  //
{
public:
  ACE_Service_Manager (void);
  virtual int list_services (void);
  virtual int reconfigure_services (void);

  // = Dynamic linking hooks.
  virtual int init (int argc, char *argv[]);
  virtual int info (char **info_string, size_t length) const;
  virtual int fini (void);

  // = Scheduling hooks.
  virtual int suspend (void);
  virtual int resume (void);  

  void dump (void) const;
  // Dump the state of an object.

  ACE_ALLOC_HOOK_DECLARE;
  // Declare the dynamic allocation hooks.

private:
  int open (const ACE_INET_Addr &sia);

  // = Demultiplexing hooks.
  virtual ACE_HANDLE get_handle (void) const;
  virtual int handle_input (ACE_HANDLE fd);
  virtual int handle_close (ACE_HANDLE fd, ACE_Reactor_Mask);
  virtual int handle_signal (int signum, siginfo_t *, ucontext_t *);

  ACE_SOCK_Stream client_stream_;
  ACE_SOCK_Acceptor acceptor_;
  int debug_;
  int signum_;
  static u_short DEFAULT_PORT_;
};

#if defined (__ACE_INLINE__)
#include "ace/Service_Manager.i"
#endif /* __ACE_INLINE__ */

#endif /* _SERVICE_MANAGER_H */