Calling a Java TrxID from Tcl

The relevant Tcl extensions are makeUpocInstance, processTrxID, and destroyUpocInstance.

These can be used directly, or a pre-provided procedure cljTrxid, which is a TrxID style interface, can be used to wrap them. Usually, the wrapping is adequate. At times, though, Java UPoC instances that are created implicitly through the wrapper are not destroyed until the Tcl interpreter shuts down.

cljTrxid requires a first argument that is a keyed list. This list must include a key CLASS which has the fully-qualified name of the TrxID subclass to use. The keyed list must also match any PropertyTree keys that the Java UPoC is expecting.

cljTrxid can be called directly, or a further wrapper might be helpful to wrap it.

proc jtrxidProcess {class msgid {userArgs {}} } {
        keylset userArgs CLASS $class
        return [cljTrxid $userArgs $msgid]
}

This can be used with no user arguments.

jrxidProcess sample.SampleTrxid message0

The return value is a string.