MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CPCD Class Reference

Manages processes, letting them be controlled with a TCP connection. More...

#include <CPCD.hpp>

Collaboration diagram for CPCD:

Classes

class  Monitor
 Starts and stops processes as needed. More...
class  Process
 Manages a process. More...
class  RequestStatus
 Describes the status of a client request. More...

Public Member Functions

 CPCD ()
 Constructs a CPCD object.
 ~CPCD ()
 Destroys a CPCD object, but does not stop the processes it manages.
bool defineProcess (RequestStatus *rs, Process *arg)
bool undefineProcess (RequestStatus *rs, int id)
bool startProcess (RequestStatus *rs, int id)
bool stopProcess (RequestStatus *rs, int id)
bool listProcesses (RequestStatus *rs, MutexVector< const char * > &)
bool saveProcessList ()
bool loadProcessList ()
MutexVector< Process * > * getProcessList ()

Public Attributes

bool loadingProcessList
MutexVector< Process * > m_processes

Friends

class Process

Detailed Description

Manages processes, letting them be controlled with a TCP connection.

The class implementing the Cluster Process Control Daemon

Definition at line 83 of file CPCD.hpp.

Member Function Documentation

bool CPCD::defineProcess ( RequestStatus rs,
Process arg 
)

Adds a Process to the CPCDs list of managed Processes.

Note
The process will not be started until it is explicitly marked as running with CPCD::startProcess().
Returns
  • true if the addition was successful,
  • false if not
  • RequestStatus will be filled in with a suitable error if an error occured.

Definition at line 73 of file CPCD.cpp.

Here is the call graph for this function:

MutexVector< CPCD::Process * > * CPCD::getProcessList ( )

Returns the list of processes

Definition at line 392 of file CPCD.cpp.

bool CPCD::listProcesses ( RequestStatus rs,
MutexVector< const char * > &   
)

Generates a list of processes, and sends them to the CPCD client

bool CPCD::loadProcessList ( )

Loads the list of Processes and their status from the configuration file.

Note
This function should only be called when the CPCD is starting, calling it at other times will cause unspecified behaviour.

Definition at line 330 of file CPCD.cpp.

Here is the call graph for this function:

bool CPCD::saveProcessList ( )

Saves the list of Processes and their status to the configuration file. Called whenever the configuration is changed.

Interactive process should never be "restarted" on cpcd restart

Definition at line 248 of file CPCD.cpp.

Here is the call graph for this function:

bool CPCD::startProcess ( CPCD::RequestStatus rs,
int  id 
)

Marks a Process for starting.

Note
The fact that a process has started does not mean it will actually start properly. This command only makes sure the CPCD will try to start it.
Returns
  • true if the marking was successful
  • false if not
  • RequestStatus will be filled in with a suitable error if an error occured.

Definition at line 138 of file CPCD.cpp.

Here is the call graph for this function:

bool CPCD::stopProcess ( CPCD::RequestStatus rs,
int  id 
)

Marks a Process for stopping.

Returns
  • true if the marking was successful
  • false if not
  • The RequestStatus will be filled in with a suitable error if an error occured.

Definition at line 183 of file CPCD.cpp.

Here is the call graph for this function:

bool CPCD::undefineProcess ( CPCD::RequestStatus rs,
int  id 
)

Removes a Process from the CPCD.

Note
A Process that is running cannot be removed.
Returns
  • true if the removal was successful,
  • false if not
  • The RequestStatus will be filled in with a suitable error if an error occured.

Definition at line 104 of file CPCD.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool CPCD::loadingProcessList

Set to true while the CPCD is reading the configuration file

Definition at line 354 of file CPCD.hpp.

MutexVector<Process *> CPCD::m_processes

The list of processes. Should not be used directly

Definition at line 372 of file CPCD.hpp.


The documentation for this class was generated from the following files: