wrench::Service Class Reference

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>

Inheritance diagram for wrench::Service:
wrench::ComputeService wrench::DataMovementManager wrench::EnergyMeterService wrench::FileRegistryService wrench::HTCondorNegotiatorService wrench::JobManager wrench::NetworkProximityService wrench::StorageService wrench::WMS

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
propertythe 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
propertythe 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
propertythe 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
propertythe 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
valuea 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_servicea shared pointer to the service
daemonizetrue if the daemon is to be daemonized, false otherwise
auto_restarttrue if the daemon should restart automatically after a reboot or not
Exceptions
std::runtime_error
std::shared_ptr<HostError>

◆ stop()

void wrench::Service::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: