WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Public Member Functions | List of all members
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::ActionExecutionService wrench::BandwidthMeterService wrench::ComputeService wrench::DataMovementManager wrench::EnergyMeterService wrench::ExecutionController wrench::FileRegistryService wrench::JobManager wrench::NetworkProximityService wrench::StorageService

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...
 
std::string getPhysicalHostname ()
 Get the physical name of the host on which the service is / will be running. More...
 
bool getPropertyValueAsBoolean (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as a boolean. More...
 
double getPropertyValueAsDouble (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as a double. More...
 
std::string getPropertyValueAsString (WRENCH_PROPERTY_TYPE)
 Get a property of the Service as a string. More...
 
unsigned long getPropertyValueAsUnsignedLong (WRENCH_PROPERTY_TYPE)
 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
ExecutionException

◆ 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

◆ getPhysicalHostname()

std::string wrench::Service::getPhysicalHostname ( )

Get the physical name of the host on which the service is / will be running.

Returns
the physical hostname

◆ getPropertyValueAsBoolean()

bool wrench::Service::getPropertyValueAsBoolean ( WRENCH_PROPERTY_TYPE  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 ( WRENCH_PROPERTY_TYPE  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 ( WRENCH_PROPERTY_TYPE  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 ( WRENCH_PROPERTY_TYPE  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
ExecutionException

◆ 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
ExecutionException
std::runtime_error

Reimplemented in wrench::ComputeService, wrench::JobManager, wrench::StorageService, wrench::DataMovementManager, wrench::EnergyMeterService, and wrench::BandwidthMeterService.


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