project BLF > class BBaseDaemonProcessor > method StopDaemon

Description

This method is called when the processing of the daemon needs to be stopped. In this method all statements that need to proceed the ending of this daemon instance should be put.
(for example specific logging)


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method BBaseDaemonProcessor.LoopForWork
method BBaseDaemonProcessor.StartDaemonProcessorInstance


program code (program1/bbasedaemonprocessor.p)

/* ================================================================= */
/*  Tell the system that this daemon processor instance is stopped   */
/* ================================================================= */
<M-2 run ControlDaemon
   (input  viFcDaemonId (iiDaemonId), 
    input  {&DAEMONSTATUS-INACTIVE} (icStatus), 
    output vcMessage (ocErrorMessage), 
    input  viFcDaemonProcessId (iiProcessId), 
    input  vcFcDaemonProcessHostName (icDaemonHostname), 
    output viFcReturnSuper (oiReturnStatus)) in BBaseDaemon>
if viFcReturnSuper <> 0
then do :
    assign oiReturnStatus = viFcReturnSuper.
    <M-3 run SetMessageInDaemonLog
       (input  'DaemonProcessor.StopDaemon; ':U + #T-15'Error when setting daemon status:':255(609257948)T-15# + vcMessage (icMessage), 
        output viFcReturnSuper (oiReturnStatus)) in BBaseDaemonProcessor>
    return.
end.