project BLF > class TDaemonUtility > method MapDaemonNameComponent

function returns character

Description

This function needs to be extended for each new daemon. It returns the name of the business component for a daemon based on the name of the daemon.
This function is used by TDaemonUtility and by TDaemon.
The code in this function should assign vcComponentName to the name of the daemon component, the daemonprocessor component or the daemonqueue component, according to the value of icType being respectively "Main", "Processor" or "Queue".
The assignment should always be done before the <ANCESTOR-CODE> tag.


Parameters


icDaemonNameinputcharacter
icTypeinputcharacterType of the component to be returned: possible values are "Master", "Processor" or "Queue".


Internal usage


BLF
method TApplication.CallUnconditionalStopDaemon
method TApplication.ClearDaemonQueue
method TDaemon.StartDaemonProcessor


program code (program1/tdaemonutility.p)

case icDaemonName:
    when {&XMLDAEMON}
    then assign vcComponentName = (if icType = {&DAEMONMAPTYPE-PROCESSOR}
                                   then "bxmldaemonprocessor"
                                   else if icType = {&DAEMONMAPTYPE-QUEUE}
                                        then "bxmldaemonqueue"
                                        else "bxmldaemon").
    when {&EVENTDAEMON}
    then assign vcComponentName = (if icType = {&DAEMONMAPTYPE-PROCESSOR}
                                   then "beventdaemonprocessor"
                                   else if icType = {&DAEMONMAPTYPE-QUEUE}
                                        then "beventdaemonqueue"
                                        else "beventdaemon").
    when {&REPORTDAEMON}
    then assign vcComponentName = (if icType = {&DAEMONMAPTYPE-PROCESSOR}
                                   then "breportdaemonprocessor"
                                   else if icType = {&DAEMONMAPTYPE-QUEUE}
                                        then "breportdaemonqueue"
                                        else "breportdaemon").
    when {&SCANDAEMON}
    then assign vcComponentName = (if icType = {&DAEMONMAPTYPE-PROCESSOR}
                                   then "bscandaemonprocessor"
                                   else if icType = {&DAEMONMAPTYPE-QUEUE}
                                        then "bscandaemonqueue"
                                        else "bscandaemon").
    when {&TIMEOUTDAEMON}
    then assign vcComponentName = (if icType = {&DAEMONMAPTYPE-PROCESSOR}
                                   then "btimeoutdaemonprocessor"
                                   else if icType = {&DAEMONMAPTYPE-QUEUE}
                                        then "btimeoutdaemonqueue"
                                        else "btimeoutdaemon").
end case.

return vcComponentName.