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::EnergyMeter wrench::FileRegistryService wrench::HTCondorNegotiatorService wrench::JobManager wrench::NetworkProximityService wrench::ServiceFailureDetector wrench::StorageService wrench::WMS

Public Types

enum  State { UP, DOWN }
 Service states. More...
 

Public Member Functions

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...
 
bool isUp ()
 Returns true if the service is UP, false otherwise. 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...
 

Detailed Description

A service that can be added to the simulation and that can be used by a WMS when executing a workflow.

Member Enumeration Documentation

◆ State

Service states.

Enumerator
UP 

UP state: the service has been started and is still running.

DOWN 

DOWN state: the service has been shutdown and/or has terminated.

Member Function Documentation

◆ 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

◆ isUp()

bool wrench::Service::isUp ( )

Returns true if the service is UP, false otherwise.

Returns
true or false

◆ 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

◆ 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::DataMovementManager, and wrench::EnergyMeter.


The documentation for this class was generated from the following files:
  • /Users/rafsilva/Documents/isi/workspace/wrench/wrench/include/wrench/services/Service.h
  • /Users/rafsilva/Documents/isi/workspace/wrench/wrench/src/wrench/services/Service.cpp