UPoCs

A user point of control (UPoC) is a code fragment that directly controls message actions.

UPoCs can modify or control the content and flow of messages, and they can control the start time of messages.

UPoCs also act on issues in protocol, presentation, and translation areas.

Note: For security, best practice is to scan any UPoC code before deployment. See Security Audit tool.

The threads within the system that use UPoCs are:

  • Inbound data (protocol issues)
  • Pre-translation (presentation and translation issues)
  • Outbound data (protocol issues)

UPoC code fragments can be implemented in Tcl or Java. Tcl is the inherent coding interface with the engine, where the engine directly invokes UPoC code segments as Tcl procedures.

Java is an extension of the Tcl interface through the Java Native Interface (JNI).

Because the UPoCs framework is implemented through TcL, you must understand TcL and the engine's architecture to understand UPoCs.

A system process is the binary program that is also called the engine. Each process contains command, translation, and protocol threads.

There is exactly one command thread and one translation thread per process, but there can be more than one protocol thread.

There is one TcL interpreter per thread. A TcL interpreter is a memory structure that is allocated per thread.

UPoC code that is written in TcL runs in the same thread as the calling procedure.

Variables follow the normal scoping rules of TcL. The scope of global variables is the lifetime of the interpreter, which lasts for the lifetime of the thread.

For example, this code makes use of this property:

set globalVar 0
proc countMessages  {} {
        upvar xlateId             xlateId             \
                xlateInList         xlateInList       \
                xlateInTypes     xlateInTypes    \
                xlateInVals        xlateInVals       \
                xlateOutList      xlateOutList     \
                xlateOutTypes  xlateOutTypes  \
                xlateOutVals     xlateOutVals
        global globalVar
        puts "globalVar: $globalVar"
        incr globalVar
}

When this is set as the inbound data TPS UPoC procedure in an inbound thread, globalVar becomes the running count of messages that have passed through the current thread.