A service that can be added to the simulation and that can be used by a WMS when executing a workflow. More...
#include <Service.h>
Public Member Functions | |
void | assertServiceIsUp () |
Throws an exception if the service is not up. More... | |
std::string | getHostname () |
Get the name of the host on which the service is / will be running. More... | |
double | getNetworkTimeoutValue () |
Returns the service's network timeout value. More... | |
bool | getPropertyValueAsBoolean (std::string) |
Get a property of the Service as a boolean. More... | |
double | getPropertyValueAsDouble (std::string) |
Get a property of the Service as a double. More... | |
std::string | getPropertyValueAsString (std::string) |
Get a property of the Service as a string. More... | |
unsigned long | getPropertyValueAsUnsignedLong (std::string) |
Get a property of the Service as an unsigned long. More... | |
bool | isUp () |
Returns true if the service is UP, false otherwise. More... | |
void | resume () |
Resume the service. More... | |
void | setNetworkTimeoutValue (double value) |
Sets the service's network timeout value. More... | |
void | start (std::shared_ptr< Service > this_service, bool daemonize, bool auto_restart) |
Start the service. More... | |
virtual void | stop () |
Synchronously stop the service (does nothing if the service is already stopped) More... | |
void | suspend () |
Suspend the service. | |
Detailed Description
A service that can be added to the simulation and that can be used by a WMS when executing a workflow.
Member Function Documentation
◆ assertServiceIsUp()
void wrench::Service::assertServiceIsUp | ( | ) |
Throws an exception if the service is not up.
- Exceptions
-
WorkflowExecutionException
◆ getHostname()
std::string wrench::Service::getHostname | ( | ) |
Get the name of the host on which the service is / will be running.
- Returns
- the hostname
◆ getNetworkTimeoutValue()
double wrench::Service::getNetworkTimeoutValue | ( | ) |
Returns the service's network timeout value.
- Returns
- a duration in seconds
◆ getPropertyValueAsBoolean()
bool wrench::Service::getPropertyValueAsBoolean | ( | std::string | property | ) |
Get a property of the Service as a boolean.
- Parameters
-
property the property
- Returns
- the property value as a boolean
- Exceptions
-
std::invalid_argument
◆ getPropertyValueAsDouble()
double wrench::Service::getPropertyValueAsDouble | ( | std::string | property | ) |
Get a property of the Service as a double.
- Parameters
-
property the property
- Returns
- the property value as a double
- Exceptions
-
std::invalid_argument
◆ getPropertyValueAsString()
std::string wrench::Service::getPropertyValueAsString | ( | std::string | property | ) |
Get a property of the Service as a string.
- Parameters
-
property the property
- Returns
- the property value as a string
- Exceptions
-
std::invalid_argument
◆ getPropertyValueAsUnsignedLong()
unsigned long wrench::Service::getPropertyValueAsUnsignedLong | ( | std::string | property | ) |
Get a property of the Service as an unsigned long.
- Parameters
-
property the property
- Returns
- the property value as an unsigned long
- Exceptions
-
std::invalid_argument
◆ isUp()
bool wrench::Service::isUp | ( | ) |
Returns true if the service is UP, false otherwise.
- Returns
- true or false
◆ resume()
void wrench::Service::resume | ( | ) |
Resume the service.
- Exceptions
-
WorkflowExecutionException
◆ setNetworkTimeoutValue()
void wrench::Service::setNetworkTimeoutValue | ( | double | value | ) |
Sets the service's network timeout value.
- Parameters
-
value a duration in seconds (<0 means: never timeout)
◆ start()
void wrench::Service::start | ( | std::shared_ptr< Service > | this_service, |
bool | daemonize, | ||
bool | auto_restart | ||
) |
Start the service.
- Parameters
-
this_service a shared pointer to the service daemonize true if the daemon is to be daemonized, false otherwise auto_restart true if the daemon should restart automatically after a reboot or not
- Exceptions
-
std::runtime_error std::shared_ptr<HostError>
◆ stop()
|
virtual |
Synchronously stop the service (does nothing if the service is already stopped)
- Exceptions
-
WorkflowExecutionException std::runtime_error
Reimplemented in wrench::ComputeService, wrench::JobManager, wrench::StorageService, wrench::EnergyMeterService, and wrench::DataMovementManager.
The documentation for this class was generated from the following files:
- Service.h
- Service.cpp