Go to the documentation of this file.00001 #ifndef _ACS_LOGGING_SERVICE_IMP_HANDLER_IMPL_H_
00002 #define _ACS_LOGGING_SERVICE_IMP_HANDLER_IMPL_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __cplusplus
00032 #error This is a C++ include file and cannot be used from plain C
00033 #endif
00034
00035 #include "acsImpBaseHandlerImpl.h"
00036
00037
00038 class ACSLoggingServiceImpHandlerImpl : public ACSImpBaseHandlerImpl<ACSLoggingServiceImpHandlerImpl>, public POA_acsdaemon::LoggingServiceImp {
00039
00040 public:
00041
00042 ACSLoggingServiceImpHandlerImpl() : ACSImpBaseHandlerImpl<ACSLoggingServiceImpHandlerImpl>(LOGGING_SERVICE) {}
00043
00044
00045
00046 void start_logging_service (
00047 const char * name,
00048 acsdaemon::DaemonCallback_ptr callback,
00049 CORBA::Short instance_number) throw(ACSErrTypeCommon::BadParameterEx, acsdaemonErrType::ServiceAlreadyRunningEx) {
00050 if (name != NULL && (strlen(name) == 0 || strcmp(name, "Log") == 0)) name = NULL;
00051 ACS_SHORT_LOG ((LM_INFO, "Starting '%s' Logging Service on Imp (instance %d).", name == NULL ? "Log" : name, instance_number));
00052 if (name != NULL) {
00053 ACS_SHORT_LOG ((LM_WARNING, "Name parameter of Logging Service startup is not supported!"));
00054 }
00055 ACSServiceRequestDescription *desc = new ACSServiceRequestDescription(LOGGING_SERVICE, instance_number);
00056
00057 context->processRequest(LOCAL, START_SERVICE, desc, callback);
00058 }
00059
00060 void stop_logging_service (
00061 const char * name,
00062 acsdaemon::DaemonCallback_ptr callback,
00063 CORBA::Short instance_number) throw(ACSErrTypeCommon::BadParameterEx, acsdaemonErrType::ServiceNotRunningEx) {
00064 if (name != NULL && (strlen(name) == 0 || strcmp(name, "Log") == 0)) name = NULL;
00065 ACS_SHORT_LOG ((LM_INFO, "Stopping '%s' Logging Service on Imp (instance %d).", name == NULL ? "Log" : name, instance_number));
00066 if (name != NULL) {
00067 ACS_SHORT_LOG ((LM_WARNING, "Name parameter of Logging Service shutdown is not supported!"));
00068 }
00069 ACSServiceRequestDescription *desc = new ACSServiceRequestDescription(LOGGING_SERVICE, instance_number);
00070
00071 context->processRequest(LOCAL, STOP_SERVICE, desc, callback);
00072 }
00073
00074 acsdaemon::ServiceState get_service_status(const char * name, CORBA::Short instance_number) throw(ACSErrTypeCommon::BadParameterEx) {
00075 return context->getACSServiceState(instance_number, name);
00076 }
00077
00078 };
00079
00080
00081
00082 #endif