T4S4  19.1 C8540 A23673
Teamcenter Gateway for SAP S/4HANA API Reference
T4X::OBJECTS Namespace Reference

Commands to work with the Object Server, the bridge from Tcl to Java. More...

Functions

 addPlugins args
 Deprecated: Add jars or directories to classpath. More...
 
 cloneDefaultJavaServer javaServerVar
 Create a java server data structure in a Tcl array derived from the default java server. Use the array in commands of the T4X::JAVASERVER namespace or after -server when invoking tpmodule. More...
 
 createJavaServer javaServerVar
 Create a java server data structure in a Tcl array. Use the array in commands of the T4X::JAVASERVER namespace or after -server when invoking tpmodule. More...
 
 extendClassPath args
 Deprecated: Add class path entries. More...
 
 extendJVMArgs args
 Deprecated: Add addtional parameters for the JVM. More...
 
 getClassPath
 Deprecated: Return the classpath. More...
 
 getDefaultJavaServer defaultJavaServerVar
 Make the given name an alias to the default java server. More...
 
 getDefaultLogChannel
 Deprecated: Return default log channel for this object server. More...
 
 isRunning args
 Test whether the ObjectServer is running or not. More...
 
 setClassPath classPathAsAList
 Deprecated: Set an alternate class path. More...
 
 setDefaultLogChannel newDefaultLogChannel
 Deprecated: Set default log channel for this object server. More...
 
 setFilterFile filterFile
 Deprecated: Specify where to configure filters to reduce the amount of traced data. More...
 
 setIdleTimeout timeout
 Deprecated: Set idle timeout, the amount of idle time after which to stop the object server. More...
 
 setInitialJavaHeapSize initialJavaHeapSizeInMegaBytes
 Deprecated: Set the initial java heap size (the value set with -Xms) More...
 
 setJavaDataModel javaDataModel
 Deprecated: Set the data model of the java virtual machine using the -d64 command line option. More...
 
 setMaximumJavaHeapSize maximumJavaHeapSizeInMegaBytes
 Deprecated: Set the maximum java heap size (the value set with -Xmx) More...
 
 setModuleClassPath args
 Set class path to be used for loading modules. More...
 
 setModuleDirPath args
 Set directory path to be used for loading modules. More...
 
 setProfilingType mem_or_cpu
 Deprecated: Set whether you want to profile execution types or memory consumption. More...
 
 setRemoteDebuggingEnabled enabledAsABoolean
 Deprecated: Set whether to prepare the object server for debugging or not. More...
 
 setRemoteDebuggingPort portAsAnInteger
 Deprecated: Set port number under which the remote debugger will connect to the object server. More...
 
 setRemoteProfilingEnabled enabledAsABoolean
 Deprecated: Set whether to prepare the object server for debugging or not. More...
 
 setTimeout timeout
 Deprecated: Set timeout, the amount of time after which to give up waiting for a result. More...
 
 setTraceFile traceFile
 Deprecated: Specify where to store trace information. More...
 
 setWaitForRemoteDebugger waitAsABoolean
 Deprecated: Control whether or not to block the object server until the remote debugger connects. More...
 
 tpalet arrayName keys handle methodName args
 Call a method and fill an array with the results. More...
 
 tpcontrol command args
 Deprecated: Control the object server. More...
 
 tpdescribe handle arrayName
 Get meta data about an object as an array. More...
 
 tpexists handle
 Test whether an object handle points to an object. More...
 
 tplet varName handle methodName args
 Call a method and set a variable from the result. More...
 
 tpletovl varName handle methodName args
 Call an overloaded method and set a variable from the result. More...
 
 tpmlet varNames handle methodName args
 Call a method and set a list of variables from the result. More...
 
 tpmodule args
 Load and initialize a module. More...
 
 tpnumbers args
 Provide symbolic names for numbers or aliases for constants existing in the java namespace. More...
 
 tprelease args
 Release the given object handles. More...
 
 tprevertto snapshot
 Revert object cache to a previously saved snapshot. More...
 
 tpsnapshot ?javaServerVar?
 Take a snapshot of the object cache to be reverted to later on for the default java server. More...
 
 tpwith handle methodName args
 Call a method. More...
 
 tpwithovl handle methodName args
 Call an overloaded method. More...
 

Detailed Description

Commands to work with the Object Server, the bridge from Tcl to Java.

The Object Server is the foundation of some of the features of T4x and its flavors. There are test scripts you can try out and look into to learn more about these features and the Object Server itself. Inside the T4x installation directory the test scripts are located in var/test. When you are in the T4x web interface (also known as Admin GUI) navigate to Script → Scripts. The test script are organized in folders and the test scripts dealing with functionality based on the Object Server are under Samples.

Find below which test scripts we have prepared to assist you in customizing Object Server based functionalities.

  • Test Scripts
    1 Name of the test script | Feature
    2 __________________________________|_________________________
    3  |
    4 Demonstrate the Oracle Connector | Oracle Connector
    5 Demonstrate the PLMXML Reader | PLMXML Reader

If you select the test script in the web interface the name of the file becomes visible. You can also look into the file using the script debugger.

Note that not all of the above features may be present in your installation of T4x.

A Note on Deprecated Commands and the JAVASERVER

Quite some commands in this namespace are marked deprecated with the hint to use their equivalents in the T4X::JAVASERVER namespace. The reason is that the deprecated commands use a single default Java pipe server. This is OK if you just want to try some things out. For serious development however you will want to use a dedicated Java pipe server. Java pipe servers are represented as Tcl arrays and their names need to be passed to the T4X::JAVASERVER commands.

Note that commands which accept object handles are called without the name of sJava server array. They get the required information from the handle.

Function Documentation

◆ addPlugins()

T4X::OBJECTS::addPlugins   args  

Deprecated: Add jars or directories to classpath.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::addPlugins

They are assumed to reside in the installation's lib directory.

Parameters
argsvariable argument list with each argument representing a jar or directory to be added to the class path

◆ cloneDefaultJavaServer()

T4X::OBJECTS::cloneDefaultJavaServer   javaServerVar  

Create a java server data structure in a Tcl array derived from the default java server. Use the array in commands of the T4X::JAVASERVER namespace or after -server when invoking tpmodule.

Parameters
javaServerVarname of an array representing the pipe server

◆ createJavaServer()

T4X::OBJECTS::createJavaServer   javaServerVar  

Create a java server data structure in a Tcl array. Use the array in commands of the T4X::JAVASERVER namespace or after -server when invoking tpmodule.

Parameters
javaServerVarname of an array representing the pipe server

◆ extendClassPath()

T4X::OBJECTS::extendClassPath   args  

Deprecated: Add class path entries.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::extendClassPath
Parameters
argsvariable argument list with each argument representing a class path entry

◆ extendJVMArgs()

T4X::OBJECTS::extendJVMArgs   args  

Deprecated: Add addtional parameters for the JVM.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::extendJVMArgs
Parameters
argsparameters to add to the command line of the JVM

◆ getClassPath()

T4X::OBJECTS::getClassPath

Deprecated: Return the classpath.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::getClassPath
Returns
the classpath

◆ getDefaultJavaServer()

T4X::OBJECTS::getDefaultJavaServer   defaultJavaServerVar  

Make the given name an alias to the default java server.

Parameters
defaultJavaServerVarName of the variable to link to the default java server.

◆ getDefaultLogChannel()

T4X::OBJECTS::getDefaultLogChannel

Deprecated: Return default log channel for this object server.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::getDefaultLogChannel
Returns
default log channel for this object server.

◆ isRunning()

T4X::OBJECTS::isRunning   args  

Test whether the ObjectServer is running or not.

Parameters
optionaljavaServerVar name of an array representing the pipe server
Returns
true if the server is running; false otherwise

◆ setClassPath()

T4X::OBJECTS::setClassPath   classPathAsAList  

Deprecated: Set an alternate class path.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setClassPath
Parameters
classPathAsAListclass path as a list of class path entries

◆ setDefaultLogChannel()

T4X::OBJECTS::setDefaultLogChannel   newDefaultLogChannel  

Deprecated: Set default log channel for this object server.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setDefaultLogChannel

Defaults to the session log channel.

Parameters
newDefaultLogChanneldefault log channel to set

◆ setFilterFile()

T4X::OBJECTS::setFilterFile   filterFile  

Deprecated: Specify where to configure filters to reduce the amount of traced data.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setFilterFile

Defaults to PipeServerTraceFilter.txt

Parameters
filterFilethe new path to the filter file

◆ setIdleTimeout()

T4X::OBJECTS::setIdleTimeout   timeout  

Deprecated: Set idle timeout, the amount of idle time after which to stop the object server.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setIdleTimeout

It is measured in seconds and defaults to 0 which means the object server will never be stopped.

Parameters
timeoutif the object server is idle during this amount of time it will be stopped; 0 is the default and means it will never be stopped.

◆ setInitialJavaHeapSize()

T4X::OBJECTS::setInitialJavaHeapSize   initialJavaHeapSizeInMegaBytes  

Deprecated: Set the initial java heap size (the value set with -Xms)

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setInitialJavaHeapSize
Parameters
initialJavaHeapSizeInMegaBytesinitial java heap size in mega bytes; if it starts with a slash the value will be a fraction of the maximum java heap size, e.g. /4 means initialJavaHeapSizeInMegaBytes = maximumJavaHeapSizeInMegaBytes / 4

◆ setJavaDataModel()

T4X::OBJECTS::setJavaDataModel   javaDataModel  

Deprecated: Set the data model of the java virtual machine using the -d64 command line option.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setJavaDataModel

This is only relevant on some Unix operating systems.

You can set this to

  • auto - The data model will be calulated from the SYS.INFO.REGL proc flag, which may not always be what you want.
  • 64 - Actually a string containing the substring 64 sets the data model to 64 bit
  • 32 - Actually a string containing the substring 32 sets the data model to 32 bit

Anything else means to not set the -d64 or -d32 command line option.

Parameters
javaDataModelthe data model for the java virtual machine

◆ setMaximumJavaHeapSize()

T4X::OBJECTS::setMaximumJavaHeapSize   maximumJavaHeapSizeInMegaBytes  

Deprecated: Set the maximum java heap size (the value set with -Xmx)

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setMaximumJavaHeapSize
Parameters
maximumJavaHeapSizeInMegaBytesmaximum java heap size in mega bytes;

◆ setModuleClassPath()

T4X::OBJECTS::setModuleClassPath   args  

Set class path to be used for loading modules.

Parameters
optionaljavaServerVar name of an array representing the pipe server
classPathAsAListclass path as a list of class path entries

◆ setModuleDirPath()

T4X::OBJECTS::setModuleDirPath   args  

Set directory path to be used for loading modules.

Parameters
optionaljavaServerVar name of an array representing the pipe server
moduleDirPathAsAListlist of directories from which to collect module jars

◆ setProfilingType()

T4X::OBJECTS::setProfilingType   mem_or_cpu  

Deprecated: Set whether you want to profile execution types or memory consumption.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setProfilingType

Choose cpu in the first and mem in the second case.

Parameters
mem_or_cpumem or cpu

◆ setRemoteDebuggingEnabled()

T4X::OBJECTS::setRemoteDebuggingEnabled   enabledAsABoolean  

Deprecated: Set whether to prepare the object server for debugging or not.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setRemoteDebuggingEnabled

Defaults to false.

Parameters
enabledAsABooleantrue if the object server is to be prepared for remote debugging.

◆ setRemoteDebuggingPort()

T4X::OBJECTS::setRemoteDebuggingPort   portAsAnInteger  

Deprecated: Set port number under which the remote debugger will connect to the object server.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setRemoteDebuggingPort

Defaults to 8000.

Parameters
portAsAnIntegerthe port number

◆ setRemoteProfilingEnabled()

T4X::OBJECTS::setRemoteProfilingEnabled   enabledAsABoolean  

Deprecated: Set whether to prepare the object server for debugging or not.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setRemoteProfilingEnabled

Defaults to false.

Parameters
enabledAsABooleantrue if the object server is to be prepared for remote debugging.

◆ setTimeout()

T4X::OBJECTS::setTimeout   timeout  

Deprecated: Set timeout, the amount of time after which to give up waiting for a result.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setTimeout

Defaults to 300000. Only applicable when using the newer EPipe based pipe server.

Parameters
timeoutthe amount of time after which to give up waiting for a result

◆ setTraceFile()

T4X::OBJECTS::setTraceFile   traceFile  

Deprecated: Specify where to store trace information.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setTraceFile

Defaults to PipeServer.trcxml

Parameters
traceFilethe new path to the trace file

◆ setWaitForRemoteDebugger()

T4X::OBJECTS::setWaitForRemoteDebugger   waitAsABoolean  

Deprecated: Control whether or not to block the object server until the remote debugger connects.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::setWaitForRemoteDebugger

Defaults to false.

Parameters
waitAsABooleantrue if the object server is supposed to block; false otherwise

◆ tpalet()

T4X::OBJECTS::tpalet   arrayName keys handle methodName args  

Call a method and fill an array with the results.

Parameters
arrayNamename of an array to which to add the results
keyslist containing the keys under which to store the result
handlehandle of the object on which to call the method
methodNamename of the method to call
argslist of arguments to pass to the method

◆ tpcontrol()

T4X::OBJECTS::tpcontrol   command args  

Deprecated: Control the object server.

Deprecated:
Use the equally named command from the T4X::JAVASERVER namespace with the additional javaServerVar argument: T4X::JAVASERVER::tpcontrol

Pass in a subordinate command. The following are available:

  • stop - Stop the object server
Parameters
commandsubordinate command, e.g. stop (see above)
argsargs for the subordinate command, depending on the particular command

◆ tpdescribe()

T4X::OBJECTS::tpdescribe   handle arrayName  

Get meta data about an object as an array.

Parameters
handlehandle of the object on which to call the method
arrayNamename of array into which to store the description

◆ tpexists()

T4X::OBJECTS::tpexists   handle  

Test whether an object handle points to an object.

Parameters
handlehandle of the object to test
Returns
true if the object handle points to an object, false otherwise

◆ tplet()

T4X::OBJECTS::tplet   varName handle methodName args  

Call a method and set a variable from the result.

Parameters
varNamename of the variable to store the result into
handlehandle of the object on which to call the method
methodNamename of the method to call
argslist of arguments to pass to the method

◆ tpletovl()

T4X::OBJECTS::tpletovl   varName handle methodName args  

Call an overloaded method and set a variable from the result.

Prepend arguments with type specifiers in parenthesis e.g. tpletovl value $obj getValueAt (int)1.

Parameters
varNamename of the variable to store the result into
handlehandle of the object on which to call the method
methodNamename of the method to call
argslist of arguments to pass to the method

◆ tpmlet()

T4X::OBJECTS::tpmlet   varNames handle methodName args  

Call a method and set a list of variables from the result.

Parameters
varNameslist containing the names of the variables to store the result into
handlehandle of the object on which to call the method
methodNamename of the method to call
argslist of arguments to pass to the method

◆ tpmodule()

T4X::OBJECTS::tpmodule   args  

Load and initialize a module.

As a side effect this starts the object server if it is not yet running.

Parameters
moduleNameThe name of the module to load
argsA list of additional arguments passed to the constuctor of the module. If it contains -server the next argument denotes the name of an array that represents the pipe server.
Returns
the handle representing the module or another object returned by the module's start method.

◆ tpnumbers()

T4X::OBJECTS::tpnumbers   args  

Provide symbolic names for numbers or aliases for constants existing in the java namespace.

Example:

1 tpnumbers PI java.lang.Math.PI E java.lang.Math.E C 299792.458
Parameters
argslist of alias value pairs. If it contains -server the next argument denotes the name of an array that represents the pipe server.

◆ tprelease()

T4X::OBJECTS::tprelease   args  

Release the given object handles.

The handles are given as the names of the variables each of which is expected to hold a single handle. The variable gets unset. It is safe to release a handle that does not point to an object.

Parameters
argsvariable args list of variables that hold an object handle to release
Returns
true if the last object handle was actually released, false if it didn't exist.

◆ tprevertto()

T4X::OBJECTS::tprevertto   snapshot  

Revert object cache to a previously saved snapshot.

NOTE that you can return to a snapshot only once as the snapshot does not contain itself.

Parameters
snapshothandle of the snapshot to which to return

◆ tpsnapshot()

T4X::OBJECTS::tpsnapshot   ?javaServerVar?  

Take a snapshot of the object cache to be reverted to later on for the default java server.

Parameters
javaServerVaroptional name of an array representing the pipe server
Returns
a handle representing the snapshot

◆ tpwith()

T4X::OBJECTS::tpwith   handle methodName args  

Call a method.

Parameters
handleof the object on which to call the method
methodNamename of the method to call
argslist of arguments to pass to the method
Returns
whatever the method returns. If it returns nothing this command returns an empty string. If it returns an array (java: java.util.Map) then it returns a list of key value pairs which can be turned into a Tcl array using the array set command.

◆ tpwithovl()

T4X::OBJECTS::tpwithovl   handle methodName args  

Call an overloaded method.

Prepend arguments with type specifiers in parenthesis e.g. tpwithovl $obj setValueAt (int)1 (string)Hello

Parameters
handleof the object on which to call the method
methodNamename of the method to call
argslist of arguments to pass to the method
Returns
whatever the method returns. If it returns nothing this command returns an empty string. If it returns an array (java: java.util.Map) then it returns a list of key value pairs which can be turned into a Tcl array using the array set command.