Loading...
Searching...
No Matches
MqContextC_EnvApi_C_API

MqContextC - protect and restore the service-environment … More...

+ Collaboration diagram for MqContextC_EnvApi_C_API:

Functions

MQ_EXTERN void MqEnvProtect_RT (MK_RT const mkrt, MQ_CTX ctx)
 protect the service-environment
 
MQ_EXTERN void MqEnvRestore (MQ_CTX ctx) MK_ATTR_HDL
 restore the service-environment
 

MqEnvLog

MQ_EXTERN void MqEnvLog_RT (MK_RT const mkrt, MQ_ENVN const env, MK_OBJN fmtobj, MK_DBG const debug, MK_STRN const callfunc, MK_I32 const lvl, MK_STRN const label)
 log the MqEnvS
 
#define MqEnvLog_0()
 
#define MqEnvLog_1(env)
 
#define MqEnvLog_2(env, fmt)
 
#define MqEnvLog_3(env, fmt, lbl)
 

MqContextC - MqContextC_EnvApi_Env_C_API - overload

#define MqEnvProtect_NULL(...)
 
#define MqEnvProtect(...)
 

Detailed Description

MqContextC - protect and restore the service-environment …

The "Env" style functions are used to secure the service-environment (defined in MqEnvS)
and is required.. under special conditions... to proper answer the original service call at the
end of the service-processing.
By default libmqmsgque guarantee the proper management of the environment on behalf of the user.
Under normal conditions the user don't need these functions.

The folllowing design-goals were defined:

The two design-goals from above are in conflict and the both functions MqEnvProtect and MqEnvRestore are used to solve this conflict.

Example from server.c protect the environment and import from database

    // in a service call
      // PROTECT the original service-call
      MqEnvProtect(mqctx);
        // OVERWRITE the original service-call with data from the database
        MqDumpImport(dump,mqctx);
        // ... do some work ...
        MK_BFL ret = MqReadALL_e(mqctx);
      // RESTORE the original service-call
      MqEnvRestore(mqctx);
    // ANSWER the original service-call
    MqSend_E(mqctx, "R", "L", ret);

Macro Definition Documentation

◆ MqEnvLog_0

#define MqEnvLog_0 ( )
Value:
MqEnvLog(&(META_CONTEXT_S)->link.protect,META_CONTEXT_S,NULL,0,__func__,0,"ENV")

Definition at line 4692 of file LibMqMsgque_mq.h.

◆ MqEnvLog_1

#define MqEnvLog_1 ( env)
Value:
MqEnvLog(env,NULL,NULL,0,__func__,0,"ENV")

Definition at line 4693 of file LibMqMsgque_mq.h.

◆ MqEnvLog_2

#define MqEnvLog_2 ( env,
fmt )
Value:
MqEnvLog(env,fmt,NULL,0,__func__,0,"ENV")

Definition at line 4694 of file LibMqMsgque_mq.h.

◆ MqEnvLog_3

#define MqEnvLog_3 ( env,
fmt,
lbl )
Value:
MqEnvLog(env,fmt,lbl,0,__func__,0,"ENV")

Definition at line 4695 of file LibMqMsgque_mq.h.

◆ MqEnvProtect

#define MqEnvProtect ( ...)
Value:
#define MK_RT_CALL
MQ_EXTERN void MqEnvProtect_RT(MK_RT const mkrt, MQ_CTX ctx)
protect the service-environment

Definition at line 171 of file msgque_overload_mq.h.

◆ MqEnvProtect_NULL

#define MqEnvProtect_NULL ( ...)
Value:
#define MK_RT_CALL_NULL

Definition at line 170 of file msgque_overload_mq.h.

Function Documentation

◆ MqEnvLog_RT()

MQ_EXTERN void MqEnvLog_RT ( MK_RT const mkrt,
MQ_ENVN const env,
MK_OBJN fmtobj,
MK_DBG const debug,
MK_STRN const callfunc,
MK_I32 const lvl,
MK_STRN const label )

log the MqEnvS

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]envthe MqEnvS instance to work on
[in]fmtobjmanaged object used to format the log-message (default=MK_NULL → use default-format)
[in]debugthe debug level from MkRuntimeS::debug, use 0 <= debug <= 9 (default=0)
[in]callfunca user-defined postfix to identify the calling function or the environment (default=name-of-function)
[in]lvla user-defined prefix starting with "" for lvl=0 and increase with " " for lvl+1 (default=0)
[in]labela string to identify a task or object
See also
MqContextC_EnvApi_C_API

◆ MqEnvProtect_RT()

MQ_EXTERN void MqEnvProtect_RT ( MK_RT const mkrt,
MQ_CTX ctx )

protect the service-environment

Parameters
[in]mkrtthe MkRuntimeS instance to work on - the runtime argument, used by MK_RT_CALL (C-only)
[in]ctxthe MqContextS instance to work on

◆ MqEnvRestore()

MQ_EXTERN void MqEnvRestore ( MQ_CTX ctx)

restore the service-environment

Parameters
[in]ctxthe MqContextS instance to work on