project BLF > class Connect > method MainBlock

Description

This method is the main method of the component, and contains all code that is executed when an appserver is connected by the client.

This method is filling in the session:server-connection-context based on the value of icAppserverInfo and it starts the ComponentPool if necessary.
As a last thing, this method also sets the internal DebugLevel to the value specified in the icAppServerInfo.


Parameters


icUserIdinputcharacterThis is a mandatory parameter of any connect procedure of an appserver.
In the current implemenation, we don't use this. It can be left blank with every connection to the appserver.
icPasswordinputcharacterThis is a mandatory parameter of any connect procedure of an appserver.
In the current implemenation, we don't use this. It can be left blank with every connection to the appserver.
icAppserverInfoinputcharacterThis is a mandatory parameter of any connect procedure of an appserver.
The format that is expected is: "lng=<languagecode>,DebugLevel=<debuglevel>"


Internal usage


unused


program code (program1/connect.p)

/* reset */
etime(yes).

assign session:server-connection-context = icAppserverInfo.

/* activate.p is included here for state-reset (has no activate procedure) */
do viFcCount1 = num-entries(session:server-connection-context) to 1 by -1:
    if entry(viFcCount1,session:server-connection-context) begins "Lng=":U
    then assign current-language = substring(entry(viFcCount1,session:server-connection-context),5,-1,"CHARACTER":U).
    else
    if entry(viFcCount1,session:server-connection-context) begins "DebugLevel=":U
    then assign viAppserverDebugLevel = integer(substring(entry(viFcCount1,session:server-connection-context),12,-1,"CHARACTER":U)) no-error.
end.

/* code copied from generated instance programs (start) */
vlFcOk = no.
publish "ComponentPoolIsRunning" (output vlFcOk).
if vlFcOk = no
then do:
    <M-1 run Main () in ComponentPool>
    session:add-super-procedure(vhFcComponent).
end.

run SetDebugLevelInPool (viAppserverDebugLevel, 0, no).