TAFJ Standalone
TAFJ Standalone
TAFJ Standalone
R18
TAFJ-S t a n d a l o n e
Amendment History:
Revisio
Date Amended Name Description
n
19th February
4 R. Vincent R14GA review
2014
20th February
5 JN.Charpin Reject parameter – tafj-maven-plugin compilation
2014
Page 2
TAFJ-S t a n d a l o n e
4th September
16 JN. Charpin Use a logger for COMOs
2017
Vinod
17 13th April 2018 Shunmugave Log redirect to Splunk
l
Basheer
18 24th August 2018 Update TAFJ Compiler section
Ahamed
Vinod
4th September
19 Shunmugave JQL Unsupported
2018
l
15th October
20 Riswana tCrypt for DLM
2018
Page 3
TAFJ-S t a n d a l o n e
Copyri g h t
Copyright (c) 2014 TEMENOS HOLDINGS NV
All rights reserved.
This document contains proprietary information that is protected by copyright. No part of this document may
be reproduced, transmitted, or made available directly or indirectly to a third party without the express
written agreement of TEMENOS UK Limited. Receipt of this material directly TEMENOS UK Limited
constitutes its express permission to copy. Permission to use or copy this document expressly excludes
modifying it for any purpose, or using it to create a derivative therefrom.
Temenos Headquarters SA
2 Rue de l’Ecole-de-Chimie,
CH - 1205 Geneva,
Switzerland
Please include your name, company, address, and telephone and fax numbers, and email
address if applicable. TAFJdev@temenos.com
Page 4
TAFJ-S t a n d a l o n e
Table of Contents
Copyright................................................................................................................................................ 4
Errata and Comments............................................................................................................................ 4
What is TAFJ.......................................................................................................................................... 9
Introduction............................................................................................................................ 9
Overview............................................................................................................................... 9
Prerequisites......................................................................................................................................... 10
Java JDK............................................................................................................................. 10
Multiple configuration............................................................................................................................ 11
Example........................................................................................................................... 12
Simple Program:.................................................................................................................. 12
Default project..................................................................................................................... 13
Logger.................................................................................................................................................. 14
Log api customization.......................................................................................................... 14
Default configuration........................................................................................................ 14
Switching log API............................................................................................................. 16
Backward compatibility, keep using log4j 1.2 natively..................................................... 17
Log folders customization.................................................................................................... 18
Logging COMO................................................................................................................... 19
Routing and file appender................................................................................................ 19
Socket appender and routing and file appender.............................................................. 20
Logger context and multi-tenant.......................................................................................... 22
Log redirect for Splunk........................................................................................................ 23
TAFJ on Multiple Servers..................................................................................................................... 24
TAFJ-Compiler..................................................................................................................................... 25
Introduction.......................................................................................................................... 25
tCompile.............................................................................................................................. 25
Syntax.............................................................................................................................. 25
Examples......................................................................................................................... 26
Excluding files from compilation...................................................................................... 27
Examples......................................................................................................................... 27
Sample basic file compilation:......................................................................................... 28
Multiple basic file compilation:......................................................................................... 29
Page 5
TAFJ-S t a n d a l o n e
Page 6
TAFJ-S t a n d a l o n e
TAFJ Monitor................................................................................................................... 54
TAFJ Printer..................................................................................................................... 54
TAFJ DataBase............................................................................................................... 57
TAFJ LockManager............................................................................................................. 58
TAFJ Locking mechanism............................................................................................... 59
TAFJ Tools........................................................................................................................................... 60
tDiag.................................................................................................................................... 60
Introduction...................................................................................................................... 60
Syntax.............................................................................................................................. 60
Example........................................................................................................................... 60
tShow.................................................................................................................................. 62
Introduction...................................................................................................................... 62
Syntax.............................................................................................................................. 62
Example........................................................................................................................... 62
tShowCheck........................................................................................................................ 63
Introduction...................................................................................................................... 63
Syntax:............................................................................................................................. 64
Example........................................................................................................................... 64
tCrypt................................................................................................................................... 66
Introduction...................................................................................................................... 66
Syntax.............................................................................................................................. 66
Example........................................................................................................................... 66
tFindDevice......................................................................................................................... 68
Introduction...................................................................................................................... 68
Syntax.............................................................................................................................. 68
Example........................................................................................................................... 68
tCreateBasicReplacement.................................................................................................................... 69
Introduction.......................................................................................................................... 69
Writing your java class........................................................................................................ 69
Syntax................................................................................................................................. 69
Example........................................................................................................................... 69
The method invoke.......................................................................................................... 70
Compiling the class............................................................................................................. 71
Registering a BASIC replacement....................................................................................... 71
Page 7
TAFJ-S t a n d a l o n e
JQL Unsupported................................................................................................................................. 73
Page 8
TAFJ-S t a n d a l o n e
What is TAFJ
Intr o d u c t i o n
TAFJ (Temenos Application Framework Java) is a Pick BASIC runtime and compiler, written
in 100% java. It allows compiling and running Pick BASIC programs. TAFJ has been written
specifically for T24 needs, and all tests and proof of concepts have been done using T24.
TAFJ also manage the connectivity on JDBC compliant databases like jBASE, Oracle,
Microsoft SQL Server, DB2, derby, derby (Embedded). It comes with an embedded
exporting tool for migrate your Pick data to Oracle.
Overvi e w
Page 9
TAFJ-S t a n d a l o n e
Prer e q u i s i t e s
Java JDK
To install TAFJ, the only prerequisite is having a Java Development Kit (JDK) version 1.8.x
installed. To check what version of java you have, type in a console:
>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121- b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed
mode)
If the version reported is not 1.8.x, you should install it. Java JDK can be downloaded here:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
NOTE: If you have installed java 1.8 but the command java -version doesn't report the
correct version, this is certainly because your PATH environment variable points to another
version. This is a bad practice to have your java virtual machine (VM) in the PATH. We highly
recommend removing it. The best practice is to set-up an environment variable called
JAVA_HOME pointing to the root directory of your Java Development Kit (JDK) installation.
Then, you could reference JAVA_HOME/bin in your PATH environment variable.
On Unix/Linux/:
export JAVA_HOME=<path_to_your_jdk>
Page 10
TAFJ-S t a n d a l o n e
Mult i p l e con f i g u r a t i o n
You can have multiple configuration file with one single setup of TAFJ. All these configuration
files will have the extension “.properties”. The default configuration is hidden in the file
“.default” which resides in the conf directory. The Eclipse Builder plug-in will generate new
configuration files using the Eclipse project name when you toggle a java project to a TAFJ
project. You can also define new configurations manually. The default property file template is
called “.properties”.
The file .default in the <TAFJ_HOME>/conf directory can be used to set a default
configuration. By default the value in the text file: .default is set to tafj.properties. If no -cf
argument is passed to tCompile, it will use the value in the file: .default (if the value in this
file is a valid properties file).
So for our examples, we will imagine that we installed one TAFJ, but we have 2 releases of
T24 : R17_3 and R17_5. For setting everything up from eclipse, please see the eclipse
documentation. Here, we will do everything manually.
First, copy .properties in a file called R17_3.properties and a second time in a file called
R17_5.properties.
.default
.properties
R17_3.properties
R17_5.properties
Page 11
TAFJ-S t a n d a l o n e
Once you are done with the modifications, you can go for a full compilation. See the
compiler documentation for more information on compiling.
Exa m p l e
Si m pl e Pr o gra m :
PROGRAM HELLO
CRT "Sample program for TAFJCore"
CRT "Please input your Name : " :
INPUT NAME
CRT "HELLO " : NAME
END
Page 12
TAFJ-S t a n d a l o n e
To Compile the T24.BP for each R10 and R11 separately (T24.BP below is a directory of
basic files).
In order to run a close of business for R17, one might start it with “START.TSM -DEBUG”,
you will just type:
Defa u l t proje c t
As previously mentioned, you can specify a default project in the file .default. For example,
with a fresh installation, the default configuration is tafj.properties, and thus the default file
contains “tafj.properties”.
So in our previous example, if you write “R17_3” or “R17_3.properties” in the .default file, you
won't need to specify the project when using tRun on the R17 configuration. You will then just
have to type:
Page 13
TAFJ-S t a n d a l o n e
Log g e r
T24 execution and TAFJ internal behavior could be monitored with logs.
Standard logging APIs (SLF4J, Log4J 1.2, Log4J 2.x) are used and a default logger
configuration, writing to files is provided within:
<TAFJ_HOME>\conf\TAFJTrace.properties.
This configuration could be either a Log4J 1.2 or Log4J2 configuration, depending either on
your TAFJ version or on the runtime configuration.
This file is generated automatically in the appropriate Log4j 1.2 or Log4j 2 format if it’s not
already existing.
For more information please refer to the appropriate logging API documentation, links are
provided in the related section.
By default, several different loggers are defined, providing information related to a specific
topic: T24, Database, Runtime, MDB, EJB, etc…
Log api cu s t o m i z a t i o n
Defa u l t con fi g u r a t i o n
The default runtime configuration is making use natively either of Log4j 1.2 or Log4j 2.
Since PB201607 (June 2016 release), historical Log4j 1.2 configuration is switched to Log4j
2.
When upgrading from an existing installation to PB201607 and higher, any older existing
TAFJTrace.properties will be overridden to fit Log4j 2 format.
For backward compatibility this is still possible to use Log4j 1.2, but not recommended as
further logging enhancements are not going to be supported with this log4j version.
Page 14
TAFJ-S t a n d a l o n e
Log 4 j co nfi g u r a t i o n
File TAFJTrace.properties for more information see
https://logging.apache.org/log4j/1.2/manual.html
log4j.debug=false
log4j.rootLogger=OFF
log4j.logger.T24=INFO, t24
log4j.logger.BASIC=ERROR, basic
log4j.logger.PRINTER=ERROR, printer
log4j.logger.DATABASE=ERROR, database
log4j.logger.JQL=ERROR, jql
log4j.logger.LOCKING=INFO, locking
log4j.logger.COMPILER=WARN, compiler
log4j.logger.DEPENDENCY=INFO, dependency
log4j.logger.RUNTIME=ERROR, runtime
log4j.logger.DBIMPORT=ERROR, dbimport
log4j.logger.SQLTRACE=ERROR, sqltrace
log4j.logger.ITYPE=ERROR, itype
log4j.logger.EXECUTE=ERROR, execute
log4j.logger.IOSERVER=INFO, ioserver
log4j.logger.MDB=ERROR, mdb
log4j.logger.EJB=ERROR, ejb
log4j.logger.MONITOR=ERROR, monitor
log4j.logger.API=INFO, api
…
Log 4 j 2 conf i g u r a t i o n
File TAFJTrace.properties for more information see http://logging.apache.org/log4j/2.x/
Page 15
TAFJ-S t a n d a l o n e
loggers =
API,BASIC,CACHE,COHERENCE,COMPILER,COMPONENT_BUILDER,COMPONENT_USAGE,DATABASE
,DATABASE_RO,DBIMPORT,DBIMPORT_COMPARER,DEPENDENCY,DBTOOLS,EJB,EXECUTE,FILTER
,ITYPE,JQL,JQL_NOTSUPPORTED,LOCKING,MDB,PRINTER,RUNTIME,SANITYCHECK,SQLTRACE,
T24,TRUN,UPDATER,WRITEOUTOFTRANS,
logger.API.name = API
logger.API.level = ERROR
logger.API.additivity = false
logger.API.appenderRefs = api
logger.API.appenderRef.api.ref = api
logger.BASIC.name = BASIC
logger.BASIC.level = ERROR
logger.BASIC.additivity = false
logger.BASIC.appenderRefs = basic
logger.BASIC.appenderRef.basic.ref = basic
logger.CACHE.name = CACHE
logger.CACHE.level = ERROR
logger.CACHE.additivity = false
logger.CACHE.appenderRefs = cache
logger.CACHE.appenderRef.cache.ref = cache
…
As stated above TAFJ is currently supporting Log4j and Log4j2, hence switching to SLF4J
would make sense in case of wanting to use Log4j as a backend API to continue using any
pre-PB201607 configuration.
Cla s s p a t h se t u p
To be able to use SLF4J and Log4j 1.2, some classpath modification needs to be done.
o <TAFJ_HOME>\3rdParty\logging\slf4j\slf4j-api.jar
o <TAFJ_HOME>\3rdParty\logging\slf4j\slf4j.log4j12.jar
o <TAFJ_HOME>\3rdParty\logging\log4j12\log4j.jar
Ru n t i m e se t u p
To switch from native Log4j2 API to SLF4J, simply set the following system property.
Page 16
TAFJ-S t a n d a l o n e
-Dtemenos.log.api=SLF4J
- Linux :
- Windows
o set temenos.log.api=SLF4J
To switch the backend API (behind SLF4J), to be Log4j 1.2 simply set the following system
property.
-Dtemenos.log.backend=LOG4J
- Linux :
- Windows
o set temenos.log.backend=LOG4J
It has to be set at TAFJ start up, and should be done through environment variables or
JVM arguments
Cla s s p a t h se t u p
To be able to use Log4j 1.2, some classpath modification needs to be done.
o <TAFJ_HOME>\3rdParty\logging\log4j12\log4j.jar
Page 17
TAFJ-S t a n d a l o n e
Ru n t i m e se t u p
To switch from native Log4j2 API to Log4j 1.2, simply set the following system property.
-Dtemenos.log.api=LOG4J
- Linux :
- Windows
Page 18
TAFJ-S t a n d a l o n e
Log fold e r s cu s t o m i z a t i o n
By default you will find above mentioned logs under following folders:
- temenos.log.directory=<PATH_TO_YOUR_TAFJ_LOG_FOLDER>
- temenos.log.directory.t24=<PATH_TO_YOUR_T24_LOG_FOLDER>
It has to be set at TAFJ start up, and should be done through environment variables or
JVM arguments.
You cannot use the tafj.properties file for that purpose as loggers get initialized before tafj
properties get loaded.
-Dtemenos.log.directory=/path/to/your/custom/log/folder
- Linux :
o export temenos_log_directory=’path/to/your/custom/log/directory’
- Windows
o set temenos.log.directory=path\to\your\custom\log\directory
To revert this setting in tafj shell, simply set the property to an empty value.
- Linux :
o export temenos_log_directory=
- Windows
o set temenos.log.directory=
Page 19
TAFJ-S t a n d a l o n e
Log g i n g COMO
When using LOG4J2 as the logging API, it is possible to redirect COMOs to a standard
logger.
Simply set the following property as system property or JVM property at application start up.
- temenos.log.como=true
It will generate the “como” logger and appender configuration within TAFJTrace
configuration.
When using an existing deployment, make sure to delete current TAFJTrace configuration
file.
The como appender and logger will be defined in the newly generated configuration file.
<TAFJ_HOME>/log_T24/como
- temenos.log.directory.como=<PATH_TO_YOUR_COMO_LOG_FOLDER>
Above properties have to be set at TAFJ start up, and should be done through
environment variables or JVM arguments.
Page 20
TAFJ-S t a n d a l o n e
In this scenario, TAFJ application will become a client of the logging server.
The appender to use on TAFJTrace configuration side will be the following, i.e. when using
properties configuration format.
#Socket client appender to be used to redirect como files to above remote routing
appender
#Setup appropriate hostname and port to match the remote logging server
appender.como.type = Socket
appender.como.name = como
appender.como.host = 10.56.7.99
appender.como.port = 1212
appender.como.layout.type = SerializedLayout
appender.como.connectTimeoutMillis = 2000
appender.como.reconnectionDelayMillis = 10000
appender.como.protocol = TCP
On the server side, the same routing appender than defined above will be used to receive
the log events from the socket and route them to the appropriate file.
1- Deploy on the logging server (LOG4J_HOME below) the following libraries which can
be found in the TAFJ release under 3rdParty\logging\log4j2:
o log4j-core.jar
o log4j-api.jar
o jcommander-1.48.jar
2- Copy on the server the TAFJTrace configuration defining the como routing appender
3- Start the TCP socket server with appropriate classpath and parameters, i.e.
set LOG4J_HOME=C:\lo4j-socket-server-conf
set CLASSPATH=%LOG4J_HOME%\*
set JAVA_OPTS=-Dtemenos.log.directory=%LOG4J_HOME%\log
-Dtemenos.log.directory.t24=%LOG4J_HOME%\t24-log -Dtemenos.log.directory.como=
%LOG4J_HOME%\como-log
The TCP socket server will be started on the specified option -p port 1212 and defining the
logger configuration coming from option -c TAFJTrace.xml.
Page 21
TAFJ-S t a n d a l o n e
In this case the client appender configuration has to be refined to define SSL parameters.
i.e.
appender.como.ssl.type = SSL
appender.como.ssl.protocol = SSL
appender.como.ssl.keystore.type=KeyStore
appender.como.ssl.keystore.location=log4j2-keystore.jks
appender.como.ssl.keystore.password=changeme
appender.como.ssl.truststore.type=TrustStore
appender.como.ssl.truststore.location=trustore.jks
appender.como.ssl.truststore.password=changeme
Page 22
TAFJ-S t a n d a l o n e
By using property
- temenos.log.context=<YOUR_CONTEXT_NAME>
When using a context you will also generate a dedicated file to configure your
appenders: TAFJTrace.<YOUR_CONTEXT_NAME>.properties file.
Like log directories properties it has to be set at TAFJ start up, and should be done through
environment variables or JVM arguments, refer to log folder customization sample above.
-Dtemenos.log.context=customLogContext
- Linux :
o export temenos_log_context=customLogContext
- Windows
o set temenos.log.context=customLogContext
To revert this setting in tafj shell, simply set the property to an empty value.
- Linux :
o export temenos_log_context=
- Windows
o set temenos.log.context=
Page 23
TAFJ-S t a n d a l o n e
To redirect logs into Splunk instance, we need to modify the following property in
tafj.properties file
o temn.tafj.runtime.redirection.logger=
By default, if the above mentioned property is empty, logs will be generated in filexplorer.
If the splunk component is provided as the value for the above mentioned property, logs will
get forwarded to splunk.
ie) temn.tafj.runtime.redirection.logger=splunk
Specify the splunk URL and token using the below mentioned two properties,
o temn.tafj.runtime.redirection.splunk.url=
o temn.tafj.runtime.redirection.splunk.token=
By default, if the above mentioned properties are not provided, the default URL and token
used.
Token = 0fbb0a31-4548-4468-a49b-64c361be3376
tCreateTraceWriter
Once the above properties are defined in tafj.properties file, user has to execute
tCreateTraceWriter file which is located inside %TAFJ_HOME%\bin directory in order to
generate the new TAFJTrace.properties file which is compatible for Splunk component.
appender.T24.name = T24
appender.T24.url = ${defaultUrl}
appender.T24.token = ${defaultToken}
appender.T24.layout.type = PatternLayout
appender.T24.layout.pattern = ${defaultPattern}
Page 24
TAFJ-S t a n d a l o n e
If you install TAFJ on multiple servers, you need then to setup the port range for each sever
and be sure no port id will be duplicate on others server.
Alternatively, you can set the following property to retrieve a unique port number from the
database. This queries a sequence named SEQ_UNIQUE_ID from the database. It should
be mentioned that this uniqueID is valid only until Java’s Max Value of Integer
(2,147,483,647), at which point the sequence will be dropped and recreated again.
temn.tafj.runtime.port.database = true
Scenario 1
All the servers have a NFS/MAP to a share HDD where TAFJ is installed.
No Need to setup any port range. All servers will share the uid (unique ID file).
HDD
\Temenos\TAFJ
Scenario 2
You need to setup for each TAFJ a port range. Each servers will have his own uid (unique
ID file).
Page 25
TAFJ-S t a n d a l o n e
TAFJ- Com p i l e r
Intr o d u c t i o n
tCompile is the main entry point for compiling a program. This is a script in the /bin directory.
It is used to execute the Compiled Basic Files
tCo m p i l e
The compilation of a basic program is done using tCompile (in the <TAFJ_HOME>/bin
directory). As there is not a VOC as such, you must give the full path to the program you
want to compile.
Syn t a x
If the Directory is missing, TAFJ will try to find the file in the current directory.
However, if wild chars are used, only the current directory will be used.
If the -I option is passed, it will override the value of the “temn.tafj.directory.insert” property.
Page 26
TAFJ-S t a n d a l o n e
Exa m p l e s
tCompile F.WRITE
tCompile /home/user/T24.BP/F.WRITE
tCompile /home/user/T24.BP
tCompile /home/user/T24.BP/F.*
tCompile ../T24.BP
Page 27
TAFJ-S t a n d a l o n e
When compiling a directory you could also exclude some files from the compilation by using
the reject option.
Exa m p l e s
Compile the content of the whole directory T24.BP but not the files starting with EB.
Compile the content of the whole directory T24.BP but not the subfolders called
SUB.
Compile the contents of the whole directory T24.BP but not the files starting with
EB contained in subfolder SUB.
Compile the contents of the whole directory T24.BP but exclude subfolder SUB and
SUB2.
You need to specify your reject pattern between double quotes when using multi-criteria
pattern.
Page 28
TAFJ-S t a n d a l o n e
Sa m p l e basi c file co m p i l a t i o n :
--------------------------------------------------------------------------------
Temenos TAFJ Compiler/Runner
TAFJCompiler.jar version "DEV_201705.0"
Copyright (c) 2009-2015 TEMENOS. All rights reserved
--------------------------------------------------------------------------------
Java Version = 1.8.0_121- b13
Java File Encoding = UTF-8
Java Home = C:\Temenos\Development\3rdParty\jdk\jdk1.8.0_121\jre
Java Classpath = Java(TM) SE Runtime Environment
--------------------------------------------------------------------------------
User Name = manojkumar
Current Dir = C:\Temenos\Development\DEV\TAFJ\bin
--------------------------------------------------------------------------------
OS Type = Windows 7
--------------------------------------------------------------------------------
TAFJ_HOME = C:\Temenos\Development\DEV\TAFJ\bin\..
Basic Source Dir. =
Insert Source Dir. =
Precompile Dir. = C:\Temenos\Development\DEV\T24\lib\Precompiled
Java Destination Dir. =
C:\Temenos\Development\3rdParty\eclipse\Workspaces\TAFJWorkspace_TAFJDEV\TEST\src
Classes Destination Dir.= C:\Temenos\Development\DEV\TAFJ\data/TEST/classes
Report Destination Dir. = C:\Temenos\Development\DEV\TAFJ\bin\..\report
Max. Grammar Level = 3
Min. Grammar Level = 0
Java Package = com.temenos.t24
Reporting = false
--------------------------------------------------------------------------------
Arguments :C:\Temenos\Development\DEV\TAFJ\samples\basic\HELLO
--------------------------------------------------------------------------------
Page 29
TAFJ-S t a n d a l o n e
--------------------------------------------------------------------------------
Temenos TAFJ Compiler/Runner
TAFJCompiler.jar version "DEV_201705.0"
Copyright (c) 2009-2015 TEMENOS. All rights reserved
--------------------------------------------------------------------------------
Java Version = 1.8.0_121- b13
Java File Encoding = UTF-8
Java Home = C:\Temenos\Development\3rdParty\jdk\jdk1.8.0_121\jre
Java Classpath = Java(TM) SE Runtime Environment
--------------------------------------------------------------------------------
User Name = manojkumar
Current Dir = C:\Temenos\Development\DEV\TAFJ\bin
--------------------------------------------------------------------------------
OS Type = Windows 7
--------------------------------------------------------------------------------
TAFJ_HOME = C:\Temenos\Development\DEV\TAFJ\bin\..
Basic Source Dir. =
Insert Source Dir. =
Precompile Dir. = C:\Temenos\Development\DEV\T24\lib\Precompiled
Java Destination Dir. =
C:\Temenos\Development\3rdParty\eclipse\Workspaces\TAFJWorkspace_TAFJDEV\TEST\src
Classes Destination Dir.= C:\Temenos\Development\DEV\TAFJ\data/TEST/classes
Report Destination Dir. = C:\Temenos\Development\DEV\TAFJ\bin\..\report
Max. Grammar Level = 3
Min. Grammar Level = 0
Java Package = com.temenos.t24
Reporting = false
--------------------------------------------------------------------------------
Arguments :C:\Temenos\Development\DEV\TAFJ\samples\basic\HELLO
C:\Temenos\Development\DEV\TAFJ\samples\basic\HELLO.FAILURE
C:\Temenos\Development\DEV\TAFJ\samples\basic\HELLO.GR0
--------------------------------------------------------------------------------
[ERROR] (line 3) HELLO.FAILURE, $INSERT DUMMY.h => DUMMY.h (The system cannot read
the file 'C:\Temenos\Development\DEV\TAFJ\bin\..\ext\DUMMY.h')
Page 30
TAFJ-S t a n d a l o n e
Und e r s t a n d i n g th e co m p i l a t i o n
The co m p i l a t i o n workfl o w
When a tCompile command is executed, first the BASIC file will be analyzed, so the
grammar level can be defined. Then, the Java file will be generated in memory.
If the option 'temn.tafj.compiler.generate.java' is set to true (default is 'false') , then the in-
memory java file will be flushed on disk at the location specified by 'temn.tafj.directory.java'
The generated java classes are all extending the main class jRuntime. This class (part of
TAFJcore, contains the definitions of all the BASIC KEYWORDS (OPEN, OCONV, …)
jRuntime
T24
During the compilation, you’ll discover that there are different levels of so called grammars,
depending on the BASIC file you are compiling.
These “grammars” are different ways of translating the BASIC to JAVA, depending on the
quality of the BASIC CODE. Today, we have 2 main grammars levels: 2/3 and 0
The grammar 2/3 implies that there are no GOTO, no ON … GOTO, no RETURN TO, and
NO label in a “branch statement.” A branch statement is the block of code you will find
between :
Page 31
TAFJ-S t a n d a l o n e
The Grammar 2/3 is the most optimized, and the generated Java is well formed and more
maintainable by a java developer.
For example, this will generate java in grammar 0 (Sample from BATCH.JOB.CONTROL):
The Label ‘LOCK.CONTROL.LIST ‘ is in a branch statement. Thus this program will compile
in grammar 0 only. To correct it, a solution would be to modify it like this:
LOOP
. . .
LOOP
LOCK.CONTROL.LIST.AGAIN = 0
READU CONTROL.LIST FROM F.BATCH.STATUS, FLAG.ID LOCKED ;* Get
hold of the control list
LOCK.CONTROL.LIST.AGAIN = 1
END ELSE ;* In case we are restarting - wait for lock!!!
. . .
END
WHILE LOCK.CONTROL.LIST.AGAIN = 1
REPEAT
UNTIL CONTROL.LIST = PROCESSED ;* Until everything has been done ; *
BG_100003752 S/E
. . .
REPEAT
The solution shown is not absolute. There are many ways to remove labels from a branch
statement.
Page 32
TAFJ-S t a n d a l o n e
jBC so u r c e na m e
In general, only A..Z, a..z , 0..9 and '.' are accepted in PROGRAM / SUBROUTINE names.
Few exceptions :
'$', '%' and '!' are also accepted, but there are exceptions and if possible, should not be
used.
Java so ur c e na m e
The name of the java class is defined by the Basic code (SUBROUTINE, PROGRAM and
FUNCTION), or if it doesn’t exist, it is named by the name of the Basic file. Java doesn’t
support all the characters BASIC allows. The conversion rules for the names (Program,
Subroutine, Function, VAR, Label, equate and insert are:
SLEEP_d_.java (SLEEP_d_.class)
Page 33
TAFJ-S t a n d a l o n e
Gen e r a t i o n of file s
As discussed, the compiler will generate two types of files. The java files containing the java
source code and the class files containing the bytecode that can be executed.
You have to specify where the compiler has to generate these files.
With the key: “temn.tafj.directory.java”, you specify where the java source files will be
generate. This key is mandatory. And you can set only one path.
With the key: ”temn.tafj.directory.classes”, you specify where the classes files will be
generate. This key is mandatory. And you can set only one path.
You have a special key: “temn.tafj.directory.insert”. This key specifies where INSERT file
is. The Insert file can be in the basic source folder or in the inserts paths.
Usually a java code is part of a package. The compiler creates a same package for all the
code compiles. To set the package, use the key: “temn.tafj.package”.
Page 34
TAFJ-S t a n d a l o n e
Dep e n d e n c i e s
There is no need to have all the SUBROUTINE to be able to compile the source required.
Example :
PROGRAM A
CALL B
END
You can tCompile A without having B. However, at runtime, if the class corresponding to “B”
is not found, a runtime error will be raised.
$ . ./tShow A
Home : '/home/user/tafj_dev/bin/..'
Page 35
TAFJ-S t a n d a l o n e
Pre c o m p i l e d Ba s i c File s
With the option “temn.tafj.directory.precompile”, you specify where the precompiled class
files are.
You can specify multiple paths separate with the separator path. “:” or “;”. These paths are
overloaded by ”temn.tafj.directory.classes” paths. If you have a class TEST.SUB in this
path and compile a TEST.PRG call TEST.SUB. The TEST.PRG will call it. Now if you
generate a new TEST.SUB in the ”temn.tafj.directory.classes”. The TEST.PRG will not call
anymore the TEST.SUB in the “temn.tafj.directory.precompile” but call the TEST.SUB in
the “temn.tafj.directory.classes”. This path could be a folder or JAR file. This does not
apply when running in an application server. In this case, the new class would have to be
added to a jar within the application server’s path.
Gram m a r Level
Already explained in the chapter “The different grammars” the level of the grammar is
automatically defined by the compiler. You can force the maximum level and the minimum
level of the grammar with the keys: “temn.tafj.compiler.grammar.maxlevel” and
“temn.tafj.compiler.grammar.minlevel”.
With the key “temn.tafj.compiler.grammar.minlevel” you can fix the minimum level of the
grammar. If the compiler has to use a level smaller than the level you fix, then an error will be
generated.
With the key “temn.tafj.compiler.grammar.maxlevel” you can fix the maximum level of the
grammar. It has to be bigger or equal of the minimum level grammar.
This option will generate the java source code with lines numbers.
Page 36
TAFJ-S t a n d a l o n e
The compiler can log why a grammar level is downgraded with the key
“temn.tafj.compiler.grammar.warning.depreciation” and if an equate is overridden with
the key temn.tafj.compiler.grammar.warning.equate.
During the compilation of a Basic file, if a compilation error occurred, a java file, containing
information to be printed on the screen when a call is executed, will be created.
Exa m p l e :
A program A
PROGRAM A
CALL B
END
A subroutime B
SUBROUTINE B()
1 CRT "TOTO"
END
$IN S E R T Stat e m e n t
By a T24 standard, a Basic Insert file should start with I_% like I_COMMON. With the key:
“temn.tafj.compiler.insert.name.any” set to true, the TAFJ compiler will accept any name
as $INSERT file.
”temn.tafj.compiler.basic.encoding” = IBM-1047
A next section presents the way you could provide options to the java compiler.
Page 37
TAFJ-S t a n d a l o n e
A property allows you to define the java version compliance you want to use. i.e when setting
1.8 you will be able to execute the generated code on targeted version and later.
“temn.tafj.compiler.javac.compliance” = 1.8
JAVAC Opti o n s
The TAFJ Compiler uses javac to compile and generate class files. With the key:
“temn.tafj.compiler.javac.options” you can specify the standard javac options.
Examples on win32
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> Specify where to find user class files and annotation processors
-cp <path> Specify where to find user class files and annotation processors
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-endorseddirs <dirs> Override location of endorsed standards path
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default
discovery process
-processorpath <path> Specify where to find annotation processors
-d <directory> Specify where to place generated class files
-s <directory> Specify where to place generated source files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced
files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-version Version information
-help Print a synopsis of standard options
-Akey[=value] Options to pass to annotation processors
-X Print a synopsis of nonstandard options
-J<flag> Pass <flag> directly to the runtime system
Page 38
TAFJ-S t a n d a l o n e
# Options for java compiler. Generate class files that target a specified version
of the VM.
# Class files will run on the specified target and on later versions, but not on
earlier versions of the VM.
# Valid targets are 1.8.
# This property set the compliance option of java compiler
#
temn.tafj.compiler.javac.compliance = 1.8
Page 39
TAFJ-S t a n d a l o n e
temn.tafj.compiler.generate.class= true
# Eclipse basic editor When set to true file parsing won't be processed on each
CR.
# To be used to speed up edition.
#Live code colorizer will be executed on save only.
#
temn.tafj.compiler.disable.cr.refresh= true
#
# Generate an error if variable is not properly initialised.
#
temn.tafj.compiler.force.variable.initialisation= true
Page 40
TAFJ-S t a n d a l o n e
It will also speed up your compilation process depending on the compilation strategy you
use.
If you are not familiar with the TAFJ maven plugin, first refer to the documentation “TAFJ
MAVEN PLUGIN”. It will help you to get started with a simple demo.
This section assumes you are familiar with maven (commands, profile and lifecycle), the tafj
maven project creation and the basic plugin usage.
What we call the tafj maven project is the pom.xml which contains your build parameters.
You need to be connected to the Temenos maven repository to use TAFJ maven
capabilities.
Page 41
TAFJ-S t a n d a l o n e
T24 co m p i l a t i o n
<parent >
<groupId >com.temenos.tafj </groupId >
<artifactId >tafj -maven -parent </artifactId >
<version >0.1.0 </version >
</parent >
As explained in “TAFJ MAVEN PLUGIN” documentation, your project must inherit from latest
tafj-maven-parent available.
We assume that you have a valid TAFJ installation under some path; a good practice is to
define this path in the properties section of your project to be able to reuse it at multiple
places.
<properties >
<tafjHome >${basedir}/tafjHome </tafjHome >
<lib.dir >${basedir}/lib </lib.dir >
<project.build.sourceEncoding >cp1252 </project.build.sourceEncoding >
</properties >
If the basic code you want to compile has some dependencies, for example T24 enterprise or
components jar files, you should define the path to these jars in a property we call ${lib.dir} in
same properties section.
Page 42
TAFJ-S t a n d a l o n e
Clas s i c co m p i l a t i o n
What we call the “classic compilation” is a compilation where tCompile is going to:
The classic compilation is suitable for small projects, as it’s compiling file by file.
<profile >
<id>tcompile </id>
<build >
<plugins >
<plugin >
<groupId >com.temenos.tafj </groupId >
<artifactId >tafj-maven-plugin </artifactId >
<executions >
<execution >
<phase >generate- sources </phase >
<goals >
<goal>compile </goal>
</goals >
<configuration >
<tafjHome >${tafjHome} </tafjHome >
<tafjProperties >tafj</tafjProperties >
<basicDir >${basedir}/src/basic/BP </basicDir >
<insertDir >${basedir}/src/basic/BP </insertDir >
<javaDir >${basedir}/src/java </javaDir >
<classesDir >${basedir}/target/classes </classesDir >
<javaPackage >com.temenos.t24 </javaPackage >
<properties >
<temn.tafj.compiler.generate.java >true </temn.tafj.compiler.generate.java >
<temn.tafj.directory.precompile >${lib.dir </temn.tafj.directory.precompile >
</properties >
</configuration >
</execution >
</executions >
</plugin >
</plugins >
</build >
</profile >
You can see that we refer to the plugin: tafj-maven-plugin and its goal compile.
By default, the goal compile is bound to the maven phase “generate-sources”, you could
change this phase to fit your build requirement.
You need to configure the configuration section with your compilation parameters:
Page 43
TAFJ-S t a n d a l o n e
- The insert directory, optional, could be read from the tafj properties file
- The java directory, optional, could be read from the tafj properties file
- The classes directory, optional, could be read from the tafj properties file
- The java package, optional, could be read from the tafj properties file
- Some additional specific tafj properties could be defined under a section <properties>
If you don’t change de default phase binding you simply have to run from the root folder of
your project command:
You will have your basic files compiled to the classes directory you specified.
If you change the phase binding, run the maven build till your targeted phase.
If you use the option keep java, do not setup your tCompile java directory to your maven
project java directory: project/src/main/java or maven compiler will also compile your java
files when reaching the phase compile.
If you run the build till the package or install phase, you will have your classes packaged into
a jar file named with the name of your project, i.e BUILD_T24.jar, if the classes folder is
matching your project/target/classes directory.
Mixe d co m p i l a t i o n
What we call the “mixed compilation” is a compilation where tCompile is going to generate
the java files only and maven compiler will compile them.
This compilation is faster than the classic compilation as there will be only one javac
compilation invoked for all java files.
For medium size projects maven compiler should be able to compile all java files in a row,
but for high size project, like full T24 compilation, we will need to use specific compiler to do
incremental compilation.
Page 44
TAFJ-S t a n d a l o n e
<profile>
<id>translate.only</id>
<build>
<plugins>
<plugin>
<groupId>com.temenos.tafj</groupId>
<artifactId>tafj-maven-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<tafjHome>${tafjHome}</tafjHome>
<tafjProperties>tafj</tafjProperties>
<basicDir>${basedir}/src/basic/BP</basicDir>
<insertDir>$
{basedir}/src/basic/BP</insertDir>
<!-- Don't change javaDir, has to be
src/main/java to have maven compiler finding
source code -->
<javaDir>${basedir}/src/main/java</javaDir>
<classesDir>$
{basedir}/target/classes</classesDir>
<javaPackage>com.temenos.t24</javaPackage>
<properties>
<temn.tafj.compiler.generate.class>false</temn.tafj.compiler.generate
.class>
<temn.tafj.compiler.generate.java>true</temn.tafj.compiler.generate.j
ava>
<temn.tafj.directory.precompile>$
{lib.dir}</temn.tafj.directory.precompile>
</properties>
</configuration>
</execution>
</executions>
</plugin>
<!-- GENERATE COMPONENT CLASSPATH -->
<plugin>
<groupId>com.googlecode.addjars-maven-plugin</groupId>
<artifactId>addjars-maven-plugin</artifactId>
<version>1.0.5</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>add-jars</goal>
</goals>
<configuration>
<resources>
<resource>
Page 45
TAFJ-S t a n d a l o n e
<directory>${lib.dir}</directory>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- compile java -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>eclipse</compilerId>
<source>1.6</source>
<target>1.6</target>
<failOnError>true</failOnError>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
We have same kind of configuration as in the classic compilation except the following points:
The java dir much match the maven project source directory to have maven compiler
compiling
<!-- Don't change javaDir, has to be src/main/java to have maven compiler finding source
code -->
<javaDir>${basedir}/src/main/java</javaDir>
You have to set property «translate only » and «keep java » to true and reference the jars
you may have dependencies on with the precompile property.
<temn.tafj.compiler.generate.class>false</temn.tafj.compiler.generate
.class>
<temn.tafj.compiler.generate.java>true</temn.tafj.compiler.generate.j
ava>
<temn.tafj.directory.precompile>$
{lib.dir}</temn.tafj.directory.precompile>
Page 46
TAFJ-S t a n d a l o n e
<groupId>com.googlecode.addjars-maven-plugin</groupId>
<artifactId>addjars-maven-plugin</artifactId>
<version>1.0.5</version>
Page 47
TAFJ-S t a n d a l o n e
<directory>${lib.dir}</directory>
<includes>
<include>**/*.jar</include>
</includes>
As mentioned above we also need to tune the maven compiler, to be able to compile high
size project, to use “eclipse plexus compiler”.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
….
<compilerId>eclipse</compilerId>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.2</version>
<scope>runtime</scope>
</dependency>
You won’t have to tune maven compiler for medium size project and you could remove the
maven compiler plugin section.
tafj-maven-plugin will generate the java files and maven compiler compile them.
If you run the build till the package or install phase, you will have your classes packaged into
a jar file named with the name of your project, i.e BUILD_T24.jar, if the classes folder is
matching your project/target/classes directory.
Page 48
TAFJ-S t a n d a l o n e
TAFJ- Run n e r
Intr o d u c t i o n
tRun is the main entry point for running a program. This is a script in the /bin directory. It is
used to execute the Compiled Basic Files
tRu n
Syn t a x
The tRun syntax is the following:
TAFJ Clas s p a t h
TAFJ is managing the classpath base on the properties file of the project. There are no need
to setup the CLASSPATH variable environment.
You can specify multiple paths separate with the separator path. “:” or “;”. Except for the key
<temn.tafj.directory.classes> only 1 folder can be specify.
I.e.
temn.tafj.directory.precompile=/T24/Modules/GB0003:/T24/lib
Page 49
TAFJ-S t a n d a l o n e
Each entry has a clear state and the defined order cannot be change.
<temn.tafj.directory.classes>
Specify where the classes’ files will be generated by the compiler.
<temn.tafj.runtime.classpath>
Specify where all internal jars and classpath before ext folder (3rd party jars and jdbc
drivers) will be loaded.
<TAFJ_HOME>/ext
Specify where all 3rd party jars, jdbc drivers and subfolder classpath will be loaded.
<temn.tafj.runtime.extended.classpath>
Specify where all internal jars and classpath after ext folder (3rd party jars and jdbc
drivers) will be loaded.
<temn.tafj.directory.precompile>
Specify where all T24, components and modules jars and classpath will be loaded.
TAFJ support UD tables. The root of the current directory where all UD tables is specify with
the key : “temn.tafj.runtime.directory.current”.
The default file encoding is UTF-8. You can spefify the file encoding of the UD Table with the
key : “temn.tafj.runtime.ud.encoding”.
Page 50
TAFJ-S t a n d a l o n e
TAFJ treat differently the directory &COMO&. You can specify where is the &COMO& folder
outside the current directory of the UD Tables with the key :
“temn.tafj.runtime.directory.como”.
# Specify what is the COMO directory.
#
temn.tafj.runtime.directory.como =
<temn.tafj.runtime.directory.current>/&COMO&
The default file encoding (empty key) is the platform specific. You can specify the file
encoding of the UD Table with the key : “temn.tafj.runtime.ud.encoding”.
# set the file encoding of the output file COMO
# ex for zOS : temn.tafj.runtime.como.encoding= IBM-1047
# default is ISO-8859-1
#
#temn.tafj.runtime.como.encoding = IBM-1047
TAFJ treat differently the directory &HOLD&. You can specify where is the &HOLD& folder
outside the current directory of the UD Tables with the key :
“temn.tafj.runtime.directory.hold”.
#Specify where is the &HOLD& directory when SETPTR is used with the HOLD option
#
temn.tafj.printer.directory.hold =
<temn.tafj.runtime.directory.current>/&HOLD&
TimeZone represents a time zone offset, and also figures out daylight savings. You can set
the Timezone with the key: “temn.tafj.runtime.timezone”.
Page 51
TAFJ-S t a n d a l o n e
temn.tafj.runtime.local = en_US
When the new process forks a new JVM, you have to specify the environment of the JVM
with options. Use the key: “temn.tafj.runtime.new.process.params”
The option can be any java options:
Usage: java [-options] class [args...]
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
-hotspot is a synonym for the "server" VM [deprecated]
The default VM is server.
-D<name>=<value> set a system property
-verbose: [class|gc|jni] enable verbose output
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
Se e h tt p: // ww w .o r ac l e. c om / te c hn e tw o rk / ja v a/ j av a se / do c um e nt a ti o n/ i nd e x. h tm l fo r m or e de ta il s.
Page 52
TAFJ-S t a n d a l o n e
By properties, you can specify the default precision for the runtime with the key:
“temn.tafj.runtime.default.precision”.
By properties, you can specify the rounding of a operation with the key:
“temn.tafj.runtime.rounding.mode” and the rounding of the result after operation with the
key : “temn.tafj.runtime.rounding.mode.result”.
# Rounding Mode result : HALF_UP(Default) (2.25 -> 2.3 and 2.24 -> 2.2)
# Possible values : HALF_DOWN, HALF_UP, HALF_EVEN, CEILING, FLOOR, UP
#
temn.tafj.runtime.rounding.mode.result = DOWN
If TAFJ is install on a Mainframe (zOS), you need to specify to true the key:
“temn.tafj.runtime.zos.mode”. It will avoid the INPUT statement with timer. (not allow on
zOS). Set the correct encoding for logger in TAFJTrace.properties and COMO encoding.
Page 53
TAFJ-S t a n d a l o n e
Page 54
TAFJ-S t a n d a l o n e
TAFJ Perfor m a n c e
For Performance raison, and if you are not in development environment you have to active
some cache and stop TAFJ to have the capability to debug code.
TAFJ has the capability to redirect API message to the logger API (T24) to the JMS Topic
Queue with the key : “temn.tafj.runtime.enable.logger.api.jms”
Page 55
TAFJ-S t a n d a l o n e
TAFJ has the capability to disable any T24 Logger API or TEC. With the key:
“temn.tafj.runtime.enable.logger.api“ and the key: “temn.tafj.runtime.disable.tec“
Page 56
TAFJ-S t a n d a l o n e
TAFJ Mon i t o r
To use TAFJ Monitor, TAFJSessionMonitor have to be up and running on the network. TAFJ
with the following properties will send all the information to the TAFJSessionMonitor. Read
the section TAFJSessionMonitor to know how setup and start the monitor.
#********************************************************************
#
# TAFJ Monitor
#
#********************************************************************
# Enable the TAFJMonitorSession
#
temn.tafj.runtime.session.monitor.enable = true
TAFJ Prin t e r
On Windows, JPS use the Printer Manager. You can connect any printer installed on
Windows. The Printer has to be online.
On UNIX/LINUX, JPS use CUPS (Common Unix Printing System). CUPS is not install by
default. You have to install it. Please refer to your OS documentation for the installation.
In the properties file, category printer, the setup of TAFJ automatically adds your printers
online with default driver name PRN #. You can affect the channel to any drivers’ name.
You can affect minimum of 3 channels to different printer with the key:
“temn.tafj.channel.name.#”. # is the number of the channel.
The default number of printer channels can be increased on demand by the below property
in properties file.
temn.tafj.printer.num.channels =
The name you affect to the key have to match the name of the driver.
i.e
temn.tafj.channel.name.0 = PRN2
Page 57
TAFJ-S t a n d a l o n e
To find the devices online on your OS, use the command tFindDevice.
__________________________________________________________________
__________________________________________________________________
Chose the device you want and add to the properties file:
temn.tafj.driver.name.# = <The name of a key to link with the channel>
temn.tafj.driver.device.# = <The name of device>
temn.tafj.driver.class.# = com.temenos.tafj.jlp.drivers.jPrinterDriver
i.e.
temn.tafj.channel.name.0 = PRN0
temn.tafj.channel.name.1 = PR23
temn.tafj.channel.name.2 = PRN1
temn.tafj.driver.name.0 = PRN0
temn.tafj.driver.device.0 = HP Officejet Pro 8600 (Network)
temn.tafj.driver.class.0 = com.temenos.tafj.jlp.drivers.jPrinterDriver
temn.tafj.driver.name.1 = PRN1
temn.tafj.driver.device.1 = Send To OneNote 2010
temn.tafj.driver.class.1 = com.temenos.tafj.jlp.drivers.jPrinterDriver
temn.tafj.driver.name.2 = PRN2
temn.tafj.driver.device.2 = Microsoft XPS Document Writer
temn.tafj.driver.class.2 = com.temenos.tafj.jlp.drivers.jPrinterDriver
Page 58
TAFJ-S t a n d a l o n e
Re d i r e c t i n g you r Re p o r t s .
It is possible in TAFJ to redirect data destined for the T24 &HOLD& UD directory to another
machine or report repository. An example follows:
temn.tafj.spooler.iohandler.host=10.41.5.52
temn.tafj.spooler.iohandler.port=22
temn.tafj.spooler.iohandler.user=t24user
temn.tafj.spooler.iohandler.password=t24user
temn.tafj.spooler.iohandler.sftp.dir=/home/t24user/tmp
temn.tafj.channel.name.0 = DEFAULT
temn.tafj.driver.name.0 = HP8000
temn.tafj.spooler.iohandler.0 = FILEHANDLER_SFTP
With the FILEHANDLER_SFTP IO handler above, the output is being redirected via SFTP to
the server 10.41.5.52 on port 22 to the directory /home/t24user/tmp. Jsch-<version>.jar
must be included in the classpath. The jar can be found in $TAFJ_HOME/3rdParty/reporting.
temn.tafj.spooler.iohandler.0 = FILEHANDLER_JACKRABBIT
Page 59
TAFJ-S t a n d a l o n e
Finally, a JCA connector has been written for these plugins when in an application server
context. Please refer to the TAFJ-AS TAFJ document for how to deploy and manage this.
Page 60
TAFJ-S t a n d a l o n e
TAFJ Data B a s e
TAFJ use JDBC to connect and use a database. Short for Java Database Connectivity, a
Java API that enables Java programs to execute SQL statements. This allows Java
programs to interact with any SQL-compliant database. Since nearly all relational database
management systems (DBMSs) support SQL, and because Java itself runs on most
platforms, JDBC makes it possible to write a single database application that can run on
different platforms and interact with different DBMSs. JDBC is similar to ODBC, but is
designed specifically for Java programs, whereas ODBC is language-independent.
temn.tafj.jdbc.url
URL that describes database connection
temn.tafj.jdbc.driver
Class that describes the specific Driver for a database
temn.tafj.jdbc.username
The username to connect
temn.tafj.jdbc.password
The password
i.e.
#********************************************************************
#
# Database setup
#
#********************************************************************
temn.tafj.jdbc.username = tafjdb
temn.tafj.jdbc.password = secret
Page 61
TAFJ-S t a n d a l o n e
!! WARNING !!
You need the specific database drivers you are targeting to go in <TAFJ_HOME>/ext.
Please find these drivers in <TAFJ_HOME>/dbdrivers and copy them to
<TAFJ_HOME>/ext
TAFJ Lock M a n a g e r
To configure the client system to use the Distributed Lock Service, each client user must be
configured with the TAFJ Locking mechanism.
To be properly effective ALL users of the same database must be configured with exactly the
same
Distributed Lock Service parameters, otherwise locks will NOT be correctly respected and
data inconsistencies may occur.
temn.tafj.locking.mode
TAFJ Distributed Lock mechanism mode.
temn.tafj.locking.hostname
Hostname or the IP address of the system where the Distributed Lock Service is
executing.
temn.tafj.locking.port
The socket port number on which TAFJ Distributed Lock service is listening.
temn.tafj.locking.callstack
Bring the current call stack over to the LockManager?
temn.tafj.locking.name
Page 62
TAFJ-S t a n d a l o n e
TAFJ Lock i n g m e c h a n i s m .
1. MEM :
The LockManager is part of the same JVM than the process running.
High Performance.
The runtime have to be in thread mode.
The locks cannot be share between multiple JVM
3. PROC / PROCHASH
The LockManager is an external process on a server in the network.
The key “temn.tafj.locking.hostname” and “temn.tafj.locking.port” have to be
set.
The PROCHASH is the same mechanism as PROC but the lock is a hash. It
cannot be monitor.
Good Performance.
Solution for DB2 database
tLockManager have to be started
4. ORCL / MSQL
The LockManager use the lock engine of the database via an API.
Good Performance.
Solution only for Oracle and MS-SQL Server
This is not the native locks of the database.
Page 63
TAFJ-S t a n d a l o n e
TAFJ Tool s
tDia g
Intr o d u c t i o n
tDiag is part of the TAFJ tools. It allows to easily get information about your environment like
the java version, the TAFJ version,… The tDiag utility is used to display information about
your TAFJ installation and projects setup. It is useful in pin-pointing problem areas of the
setup.
Syn t a x
The tDiag syntax is the following:
Exa m p l e
To get information about all projects you have configured
tDiag
Page 64
TAFJ-S t a n d a l o n e
H om e : ' C: \T em en o s\ D ev e lo p me n t\ D EV \ TA F J\ b in \ .. '
C on f di re ct or y : ' C: \T em en o s\ D ev e lo p me n t\ D EV \ TA F J\ b in \ .. / co n f'
L og di re ct or y : ' C: \T em en o s\ D ev e lo p me n t\ D EV \ TA F J\ b in \ .. \ lo g '
L og di re ct or y T2 4 : ' C: \T em en o s\ D ev e lo p me n t\ D EV \ TA F J\ b in \ .. \ lo g _T 2 4'
L og gi ng im pl em en ta t io n : L OG 4J 2
V er si on : D EV _2 01 70 5
_ __ __ __ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __
j av a. ho me : C :\ Te me no s \D e ve l op m en t \3 r dP a rt y \j d k\ j dk 1 .8 . 0_ 1 21 \ jr e
j av a. ve nd o r : O ra cl e Co rp or at i on
j av a. ve rs i on : 1 .8 .0 _1 21
o s. ar ch : a md 64
o s. na me : W in do ws 7
H os tN am e : L JR QK R3 2
I P A dd re ss : 1 0. 30 .2 01 . 10
R un ti me : D ou bl e By te S ys Se pa ra t or
_ __ __ __ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __
D ef au lt Pr oj ec t : ' TE ST '
_ __ __ __ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __
C om mo n va li da ti o n:
C om mo n va li da ti o n c om pl et ed - A ll fi ne
_ __ __ __ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __
- Pr oj ec t : ' TE ST '
Ja va sr c di r : C: \T em en o s\ D ev e lo p me n t\ D EV \ TA F J\ d at a \T E ST \ ja v a
Ja va cl as se s d ir : C: \T em en o s\ D ev e lo p me n t\ D EV \ TA F J\ d at a \T E ST \ cl a ss e s
Pr ec om pi le : C: \T em en o s\ D ev e lo p me n t\ D EV \ T2 4 \l i b\ P re c om p il e d
Up da te d ir : C: \T em en o s\ D ev e lo p me n t\ D EV \ TA F J\ b in \ .. / up d at e s
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -
Ja va de fa ul t p ac ka ge : co m. te me n os . t2 4
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -
Da ta Ba se UR L : jd bc :h 2: t cp : // l oc a lh o st / DE V
Da ta Ba se us er : t2 4
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -
Lo ck in g mo de : JD BC
Lo ck in g na me :
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -
Cu rr en t di r :
C :\ Te me no s \D e ve l op m en t \D E V\ T AF J \b i n\ . ./ . ./ T 24 / da t a/ T 24 U D
Co mo di r :
C :\ Te me no s \D e ve l op m en t \D E V\ T AF J \b i n\ . ./ . ./ T 24 / da t a/ T 24 U D/ & CO M O&
Ho ld di r :
C :\ Te me no s \D e ve l op m en t \D E V\ T AF J \b i n\ . ./ . ./ T 24 / da t a/ T 24 U D/ & HO L D&
UD en co di ng : UT F- 8
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -
Ti me zo ne :
Lo ca l : en _U S
De bu g en ab le d : tr ue
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -
JM S l og ge r en ab le d : fa ls e
Lo gg er A PI en ab le d : tr ue
TE C d is ab le d : fa ls e
-- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- -
Se ss io n mo ni to r e na bl ed : tr ue
Se ss io n mo ni to r h os t : lo ca lh os t
Se ss io n mo ni to r p or t : 83 77
__ __ __ __ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ _
Pr oj ec t va li da ti o n:
TA FJ J av a F un ct io ns V er si on i n D B : 1 8. 0. 0
TA FJ Ja va F un ct io ns Ve rs io n i n F il e : 18 .0 .0
No du pl ic at ed c la ss es f ou nd .
Page 65
TAFJ-S t a n d a l o n e
tSh o w
Intr o d u c t i o n
tShow is part of the TAFJ tools. It allows finding easily where your BASIC source has been
compiled, when and on what machine it has been compiled. It can search for the resource on
one single project and multiple ones.It can also produce a report of all the duplicate classes
when run with –d argument.
Syn t a x
The tShow syntax is the following:
Exa m p l e
To view where CACHE.READ is, just type
tShow CACHE.READ
It will, for all projects in your distribution, try to load the java class for CACHE.READ
(CACHE_READ_cl.class), and get information like:
Page 66
TAFJ-S t a n d a l o n e
tShow -d
tSh o w C h e c k
Intr o d u c t i o n
tShowCheck is part of the TAFJ tools. It allows to find out easily whether all the BASIC
source files have been compiled successfully. It reports the error and warning messages to a
flat file if a class is found missing in the precompiled or in the classes folder.
-s <PATH_OF_SOURCE_FOLDER>
Page 67
TAFJ-S t a n d a l o n e
-p <PATH_OF_PRECOMPILED> or <PATH_OF_CLASSES_FOLDER>
-r <PATH_OF_REPORT_FOLDER>
Syn t a x:
The tShowCheck syntax is the following:
Exa m p l e
Page 68
TAFJ-S t a n d a l o n e
Page 69
TAFJ-S t a n d a l o n e
tCrypt
Intr o d u c t i o n
tCrypt is part of the TAFJ tools. It allows encrypting the password specified in
temn.tafj.jdbc.password. This will encrypt the password with DES3 Algorithm. The key used
to encrypt is auto generated and stored in a file called .key in the conf directory of your TAFJ
installation.
Syn t a x
The tCrypt syntax is the following:
extract
Exa m p l e
To get encrypt the password for the database mentioned in configuration file
C:\TAFJ\bin>tCrypt
Configuration: 'C:\TAFJ\bin\..\conf\tafj.properties'
Configuration file changed with encrypted password.
C:\TAFJ\bin>
temn.tafj.jdbc.username = t24
temn.tafj.jdbc.password = secret
temn.tafj.jdbc.username = t24
temn.tafj.jdbc.password = ::P6PeGkfV134=
Page 70
TAFJ-S t a n d a l o n e
t em n. ta fj . jd b c. r o. u se r na m e = t2 4u se r1 ,t 2 4u s er 2
t em n. ta fj . jd b c. r o. p as s wo r d = se cr et 1, se c re t 2
After tCrypt, each password separated by comma is encrypt and will look like
this:
t em n. ta fj . jd b c. r o. u se r na m e = t2 4u se r1 , t2 4 us e r2
t em n. ta fj . jd b c. r o. p as s wo r d = :: 23 hK Ms I lA 2 UF 5 h1 U nP i /0 Q == , :: XK 7a yg pD a Rk =
A new password for another database can be added and encrypted using tCrypt:
t em n. ta fj . jd b c. r o. u se r na m e = t2 4u se r1 , t2 4 us e r2 , t2 4 us e r3
t em n. ta fj . jd b c. r o. p as s wo r d = :: 23 hK Ms I lA 2 UF 5 h1 U nP i /0 Q == , :: XK 7a yg pD a Rk = ,
secret3
t em n. ta fj . jd b c. r o. u se r na m e = t2 4u se r1 , t2 4 us e r2 , t2 4 us e r3
t em n. ta fj . jd b c. r o. p as s wo r d = :: 23 hK Ms I lA 2 UF 5 h1 U nP i /0 Q == , :: XK 7a yg pD a Rk = ,
: :w hH Sw mv j tr 0 =
t em n. ta fj . jd b c. r o. u se r na m e = t2 4u se r1 , t2 4 us e r2 , t2 4 us e r3
t em n. ta fj . jd b c. r o. p as s wo r d = :: 23 hK Ms I lA 2 UF 5 h1 U nP i /0 Q == , ne ws ec re t2 ,
: :w hH Sw mv j tr 0 =
t em n. ta fj . jd b c. r o. u se r na m e = t2 4u se r1 , t2 4 us e r2 , t2 4 us e r3
t em n. ta fj . jd b c. r o. p as s wo r d = :: 23 hK Ms I lA 2 UF 5 h1 U nP i /0 Q == ,
: :r tn 2R Qv h Vf K 56 e Rb P tC q Eg = = , : :w hH Sw mv jt r 0=
Page 71
TAFJ-S t a n d a l o n e
tFin d D e v i c e
Intr o d u c t i o n
tFindDevice is part of the TAFJ tools. It allows to easily getting information about your
Default Printer on your System and a list of printers which are available on your system.
Syn t a x
The tFindDevice syntax is the following:
tFindDevice
Exa m p l e
To Find the Default printer on your system
tFindDevice
__________________________________________________________________
__________________________________________________________________
Page 72
TAFJ-S t a n d a l o n e
tCre a t e B a s i c R e p l a c e m e n t
Intr o d u c t i o n
This chapter will cover how you can easily and safely write java code and invoke it directly
from BASIC. You can write your own java class, and setup the TAFJ runtime to use it instead
of a BASIC subroutine. You also can simply invoke your java class without having a
corresponding BASIC subroutine. Of course, the whole environment (like COMMONs) is
available in your java class.
This class must also implement a static method “INSTANCE” and a public method stack.
In order to make your live easier, and to avoid the copy/paste paradigm, there is a tool
available in the <TAFJ_HOME>/bin directory : tCreateBasicReplacement (.bat)
Syn t a x
The tCreateBasicReplacement syntax is the following:
Exa m p l e
To create a java MailSender
tCreateBasicReplacement com.temenos.t24.MailSender
Page 73
TAFJ-S t a n d a l o n e
The above command will create, in the ext directory, the correct file structure and the class
template you specified :
ext/
|_ com/
|_ temenos/
|_ t24/
|_ MailSender.java
The class MailSender contains all the necessary information for being invoked from BASIC.
You will need to add your custom code in the method invoke(Object... args).
The m e t h o d invo k e
The argument of this method is an array of objects. These objects are in fact jVar (a
variable), and you can cast them to get the correct reference.
Despite the fact that the TAFJ jVar object is not part of any API, here are few useful methods
:
There are MANY methods available, but this is not the purpose of this document to list them
all.
Page 74
TAFJ-S t a n d a l o n e
Com p i l i n g th e cla s s
You can compile this class as any other java class. The only dependency is on the
TAFJCore.jar library.
Re g i s t e r i n g a BASIC repl a c e m e n t
Once the class has been implemented (and compiled!) you will need to let the runtime know
about it. To do that, edit the property file of your project (default is tafj.properties) and find the
basic replacement section. This section looks like this by default :
#********************************************************************
#
# Basic Replacement
#
#********************************************************************
#
# These properties are shortcuting the CALL statement to invoke
# Directly a javaClass.
# The Parameters are all jVar and the count must match the
# Basic equivalent.
# The count must not be discountinuous. This means that if
# there is ...1, ...2, ...4 without ...3, ...4 will not be read and thus ignored.
#
temn.tafj.directory.ext = <tafj.home>/ext
temn.tafj.migration.basic.1 = CHECK.ROUTINE.EXIST
temn.tafj.migration.java.1 = com.temenos.tafj.basic.CheckRoutineExist
temn.tafj.migration.basic.2 = EB.CREATE.VIEW
temn.tafj.migration.java.2 = com.temenos.tafj.basic.EbCreateView
temn.tafj.migration.basic.3 = EB.TRACE.CALL
temn.tafj.migration.java.3 = com.temenos.tafj.basic.EbTraceCall
temn.tafj.migration.basic.4 = EBS.CREATE.FILE
temn.tafj.migration.java.4 = com.temenos.tafj.basic.EbsCreateFile
Page 75
TAFJ-S t a n d a l o n e
As you can see, there is already few basic replacements defined by default. The only thing
you need to do is to add yours at the end of the list like this :
#********************************************************************
#
# Basic Replacement
#
#********************************************************************
#
# These properties are shortcuting the CALL statement to invoke
# Directly a javaClass.
# The Parameters are all jVar and the count must match the
# Basic equivalent.
# The count must not be discountinuous. This means that if
# there is ...1, ...2, ...4 without ...3, ...4 will not be read and thus ignored.
#
temn.tafj.directory.ext = <tafj.home>/ext
temn.tafj.migration.basic.1 = CHECK.ROUTINE.EXIST
temn.tafj.migration.java.1 = com.temenos.tafj.basic.CheckRoutineExist
temn.tafj.migration.basic.2 = EB.CREATE.VIEW
temn.tafj.migration.java.2 = com.temenos.tafj.basic.EbCreateView
temn.tafj.migration.basic.3 = EB.TRACE.CALL
temn.tafj.migration.java.3 = com.temenos.tafj.basic.EbTraceCall
temn.tafj.migration.basic.4 = EBS.CREATE.FILE
temn.tafj.migration.java.4 = com.temenos.tafj.basic.EbsCreateFile
temn.tafj.migration.basic.5 = SEND.MAIL
temn.tafj.migration.java.5 = com.temenos.t24.MailSender
The next time you will compile SEND.MAIL, instead to compile SEND.MAIL, TAFJ Compiler
will create a wrapper to call your Basic Replacement.
When TAFJ will execute a CALL SEND.MAIL(...), it will invoke the method invoke(Object...
args) of your class com.temenos.t24.MailSender.
Page 76
TAFJ-S t a n d a l o n e
JQL Un s u p p o r t e d
Page 77