8 #define DRIPLINE_EXAMPLES_API_EXPORTS 17 #include "signal_handler.hh" 22 LOGGER(
dlog,
"simple_service" )
27 simple_service::simple_service(
const scarab::param_node& a_config ) :
40 scarab::signal_handler t_sig_hand;
41 t_sig_hand.add_cancelable(
this );
51 catch( std::exception& e )
53 LERROR(
dlog,
"Exception caught: " << e.what() );
57 if( scarab::signal_handler::get_exited() )
59 f_return = scarab::signal_handler::get_return_code();
67 if( a_request->parsed_specifier().empty() )
72 std::string t_specifier = a_request->parsed_specifier().front();
73 a_request->parsed_specifier().pop_front();
75 if( t_specifier ==
"echo" )
78 LDEBUG(
dlog,
"Echoing payload: \n" << a_request->payload() );
79 t_reply->set_payload( a_request->payload().clone() );
82 else if( t_specifier ==
"error" )
84 throw std::runtime_error(
"An error occurred in the endpoint! (Note: this is a test, this is only a test)" );
virtual unsigned rc_value() const
std::shared_ptr< msg_request > request_ptr_t
Dripline-specific errors.
static scarab::logger dlog("simple_service")
Consumer of Dripline messages on a particular queue.
static scarab::logger dlog("agent")
virtual ~simple_service()
std::shared_ptr< msg_reply > reply_ptr_t
virtual reply_ptr_t do_cmd_request(const request_ptr_t a_request)