#include <Service_Config.h>
Collaboration diagram for ACE_Service_Config:
Public Types | |
enum | { MAX_SERVICES = ACE_DEFAULT_SERVICE_REPOSITORY_SIZE } |
Public Methods | |
ACE_Service_Config (int ignore_static_svcs = 1, size_t size = ACE_Service_Config::MAX_SERVICES, int signum = SIGHUP) | |
Initialize the Service Repository. | |
ACE_Service_Config (const ACE_TCHAR program_name[], const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY) | |
virtual | ~ACE_Service_Config (void) |
Perform user-specified close activities and remove dynamic memory. | |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Static Public Methods | |
int | open_i (const ACE_TCHAR program_name[], const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY, int ignore_default_svc_conf_file = 0, int ignore_debug_flag = 0) |
int | open (const ACE_TCHAR program_name[], const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY, int ignore_static_svcs = 1, int ignore_default_svc_conf_file = 0, int ignore_debug_flag = 0) |
int | open (int argc, ACE_TCHAR *argv[], const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY, int ignore_static_svcs = 1, int ignore_default_svc_conf = 0, int ignore_debug_flag = 0) |
int | close (void) |
Tidy up and perform last rites when ACE_Service_Config is shut down. This method calls <close_svcs>. Returns 0. | |
int | fini_svcs (void) |
Perform user-specified close hooks and possibly delete all of the configured services in the <Service_Repository>. | |
int | close_svcs (void) |
int | close_singletons (void) |
int | run_reactor_event_loop (void) |
int | run_reactor_event_loop (ACE_Time_Value &tv) |
int | end_reactor_event_loop (void) |
int | reactor_event_loop_done (void) |
int | reconfig_occurred (void) |
True if reconfiguration occurred. | |
void | reconfig_occurred (int) |
Indicate that reconfiguration occurred. | |
void | reconfigure (void) |
Perform the reconfiguration process. | |
ACE_STATIC_SVCS* | static_svcs (void) |
Returns a pointer to the list of statically linked services. | |
ACE_Reactor* | reactor (void) |
ACE_Reactor* | reactor (ACE_Reactor *) |
ACE_Service_Repository* | svc_rep (void) |
ACE_Service_Repository* | svc_rep (ACE_Service_Repository *) |
ACE_Thread_Manager* | thr_mgr (void) |
ACE_Thread_Manager* | thr_mgr (ACE_Thread_Manager *) |
ACE_Allocator* | alloc (void) |
ACE_Allocator* | alloc (ACE_Allocator *) |
int | initialize (const ACE_Service_Type *, ACE_TCHAR parameters[]) |
Dynamically link the shared object file and retrieve a pointer to the designated shared object in this file. | |
int | initialize (const ACE_TCHAR svc_name[], ACE_TCHAR parameters[]) |
Initialize and activate a statically <svc_name> service. | |
int | resume (const ACE_TCHAR svc_name[]) |
Resume a <svc_name> that was previously suspended or has not yet been resumed (e.g., a static service). | |
int | suspend (const ACE_TCHAR svc_name[]) |
int | remove (const ACE_TCHAR svc_name[]) |
Totally remove <svc_name> from the daemon by removing it from the ACE_Reactor, and unlinking it if necessary. | |
ACE_INLINE void | signal_handler (ACE_Sig_Adapter *) |
Set the signal_handler;for internal use by ACE_Object_Manager only. | |
int | process_directive (const ACE_TCHAR directive[]) |
Process one service configuration <directive>, which is passed as a string. Returns the number of errors that occurred. | |
int | process_directive (const ACE_Static_Svc_Descriptor &ssd, int force_replace = 0) |
Process one static service definition. More... | |
int | process_directives (void) |
void | handle_signal (int sig, siginfo_t *, ucontext_t *) |
Handles signals to trigger reconfigurations. | |
int | parse_args (int, ACE_TCHAR *argv[]) |
Static Protected Methods | |
int | process_commandline_directives (void) |
Process service configuration requests that were provided on the command-line. Returns the number of errors that occurred. | |
int | process_directives_i (void) |
int | start_daemon (void) |
Become a daemon. | |
int | load_static_svcs (void) |
Add the default statically-linked services to the . | |
Static Private Methods | |
int | init_svc_conf_file_queue (void) |
Initialize the <svc_conf_file_queue_> if necessary. | |
Static Private Attributes | |
const ACE_TCHAR* | logger_key_ |
Indicates where to write the logging output. This is typically either a STREAM pipe or a socket address. | |
ACE_STATIC_SVCS* | static_svcs_ |
Singleton repository of statically linked services. | |
ACE_SVC_QUEUE* | svc_queue_ |
Queue of services specified on the command-line. | |
ACE_SVC_QUEUE* | svc_conf_file_queue_ |
Queue of svc.conf files specified on the command-line. This should probably be made to handle unicode filenames... More... | |
sig_atomic_t | reconfig_occurred_ |
True if reconfiguration occurred. | |
int | be_a_daemon_ |
Shall we become a daemon process? | |
int | no_static_svcs_ |
Should we avoid loading the static services? | |
int | signum_ |
Number of the signal used to trigger reconfiguration. | |
ACE_Sig_Adapter* | signal_handler_ |
Handles the reconfiguration signals. | |
int | is_initialized_ |
The uses the Monostate pattern. Therefore, you can only have one of these instantiated per-process. NOTE: the signal_handler_ static member is allocated by the . The constructor uses signal_handler_. Therefore, if the program has any static objects, there might be initialization order problems. They can be minimized, but not eliminated, by _not_ defining .
|
|
|
Initialize the Service Repository.
|
|
Performs an open without parsing command-line arguments. The <logger_key> indicates where to write the logging output, which is typically either a STREAM pipe or a socket address. |
|
Perform user-specified close activities and remove dynamic memory.
|
|
Set pointer to a process-wide and return existing pointer. DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Get pointer to a default . DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Tidy up and perform last rites when ACE_Service_Config is shut down. This method calls <close_svcs>. Returns 0.
|
|
Delete the dynamically allocated Singletons (i.e., the <Reactor>, <Proactor>, <ReactorEx>, and <Thread_Manager>. Returns 0. |
|
Perform user-specified close hooks on all of the configured services in the <Service_Repository>, then delete the <Service_Repository> itself. Returns 0. |
|
Dump the state of an object.
|
|
Instruct the to terminate its event loop and notifies the so that it can wake up and close down gracefully. DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Perform user-specified close hooks and possibly delete all of the configured services in the <Service_Repository>.
|
|
Handles signals to trigger reconfigurations.
|
|
Initialize the <svc_conf_file_queue_> if necessary.
|
|
Initialize and activate a statically <svc_name> service.
|
|
Dynamically link the shared object file and retrieve a pointer to the designated shared object in this file.
|
|
Add the default statically-linked services to the .
|
|
This is the primary entry point into the ACE_Service_Config (the constructor just handles simple initializations). It parses arguments passed in from and parameters. The arguments that are valid in a call to this method include:
The <logger_key> indicates where to write the logging output, which is typically either a STREAM pipe or a socket address. If <ignore_static_svcs> is 1 then static services are not loaded, otherwise, they are loaded. If <ignore_default_svc_conf_file> is non-0 then the <svc.conf> configuration file will be ignored. Returns zero upon success, -1 if the file is not found or cannot be opened (errno is set accordingly), otherwise returns the number of errors encountered loading the services in the specified svc.conf configuration file. If <ignore_debug_flag> is non-0 then the application is responsible for setting the appropriately. |
|
Performs an open without parsing command-line arguments. The <logger_key> indicates where to write the logging output, which is typically either a STREAM pipe or a socket address. If <ignore_static_svcs> is 1 then static services are not loaded, otherwise, they are loaded. If <ignore_default_svc_conf_file> is non-0 then the <svc.conf> configuration file will be ignored. Returns zero upon success, -1 if the file is not found or cannot be opened (errno is set accordingly), otherwise returns the number of errors encountered loading the services in the specified svc.conf configuration file. If <ignore_debug_flag> is non-0 then the application is responsible for setting the appropriately. |
|
Performs an open without parsing command-line arguments. The <logger_key> indicates where to write the logging output, which is typically either a STREAM pipe or a socket address. If <ignore_default_svc_conf_file> is non-0 then the "svc.conf" file will be ignored. If <ignore_debug_flag> is non-0 then the application is responsible for setting the appropriately. Returns number of errors that occurred on failure and 0 otherwise. |
|
Handle the command-line options intended for the . Note that is assumed to be the program name. The arguments that are valid in a call to this method are
|
|
Process service configuration requests that were provided on the command-line. Returns the number of errors that occurred.
|
|
Process one static service definition. Load a new static service into the ACE_Service_Repository.
|
|
Process one service configuration <directive>, which is passed as a string. Returns the number of errors that occurred.
|
|
Process (or re-process) service configuration requests that are provided in the svc.conf file(s). Returns the number of errors that occurred. |
|
This is the implementation function that <process_directives> and <process_directive> both call. Returns the number of errors that occurred. |
|
Set pointer to a process-wide and return existing pointer. DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Get pointer to a process-wide . DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Report if the Reactor's event loop is finished. DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Indicate that reconfiguration occurred.
|
|
True if reconfiguration occurred.
|
|
Perform the reconfiguration process.
|
|
Totally remove <svc_name> from the daemon by removing it from the ACE_Reactor, and unlinking it if necessary.
|
|
Resume a <svc_name> that was previously suspended or has not yet been resumed (e.g., a static service).
|
|
Run the event loop until the method returns -1, the <end_reactor_event_loop> method is invoked, or the expires. DO NOT USE THIS METHOD. It may be unsupported in future releases. <Use ACE_Reactor::run_event_loop> instead. |
|
Run the event loop until the method returns -1 or the <end_reactor_event_loop> method is invoked. DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Set the signal_handler;for internal use by ACE_Object_Manager only.
|
|
Become a daemon.
|
|
Returns a pointer to the list of statically linked services.
|
|
Suspend <svc_name>. Note that this will not unlink the service from the daemon if it was dynamically linked, it will mark it as being suspended in the Service Repository and call the <suspend> member function on the appropriate . A service can be resumed later on by calling the <RESUME> member function... |
|
Set pointer to a process-wide and return existing pointer. DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Get pointer to a process-wide . DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Set pointer to a process-wide and return existing pointer. DO NOT USE THIS METHOD. It may be unsupported in future releases. Use ACE_Thread_Manager::instance() instead. |
|
Get pointer to a process-wide . DO NOT USE THIS METHOD. It may be unsupported in future releases. Use instead. |
|
Declare the dynamic allocation hooks.
|
|
Shall we become a daemon process?
|
|
Keep track of whether the is already initialized. If so, we can't allow <yyparse> to be called since it's not reentrant. This variable is incremented by the method and decremented by the method. |
|
Indicates where to write the logging output. This is typically either a STREAM pipe or a socket address.
|
|
Should we avoid loading the static services?
|
|
True if reconfiguration occurred.
|
|
Handles the reconfiguration signals.
|
|
Number of the signal used to trigger reconfiguration.
|
|
Singleton repository of statically linked services.
|
|
Queue of svc.conf files specified on the command-line. This should probably be made to handle unicode filenames... @ |
|
Queue of services specified on the command-line.
|