TC2.Temenos Connectors Plug Ins R10.01
TC2.Temenos Connectors Plug Ins R10.01
TC2-TC Plugins-R10.01 1
After completing this learning unit/course, you will be able to understand,
•Define plug-in
•Types of plug-ins
•Default plug-ins
•Plug-in oriented TCServer Architecture
•User defined plug-ins
TC2-TC Plugins-R10.01 2
As you are already familiar with listener and adapter these are nothing but plug-ins to
TCServer.
Since version 1.3.1 of the Temenos Connector Server, All Listener, Adapter and Formatters
are packaged as plug-ins. This means that these are individual components, easy to install or
remove, having there own settings and purposes. Each plug-in can have
a different version of the core TCS. This philosophy makes maintenance easier. You can write
your own plug-in for this to understand please refer to guide-writing-plugins.
TC2-TC Plugins-R10.01 3
As you can see TCServer allows you create plugins which are of four types namely Listener
plugin, Splitter plugin, Adapter plugin, Formatter plugin.
For example,
OFSML as such acts as a Formatter plugin (it transform the message from OFSML to OFS
and vice versa).
TC2-TC Plugins-R10.01 4
Now you are familiar with plug-in types let’s make this more elaborative.
-A“Listener” is supposed to receive messages from the “external” world (eg: TCP,SSL,
MQSeries, Files, ….)
-A splitter is also a plugin (a .jar file) that is capable of splitting requests/responses that come
to/go out TCS based on a separator that is user
definable. An important point to note is that, a splitter re-concatenates the message once it
has processed it.
-An Adapter will, in opposite to a listener, “process” the message received. The communication
with T24 (via tSS) is just a specific Adapter. An adapter is actually a plug-in (a .jar file) that TCS
can recognise. TCS can recognise this .jar file provided it is placed in the ext directory where
TCS has been installed.
There are various adapters that come as a part of TCS. Refer the tcserver.xml file for a list of
these adapters.
-A Formatter will modify the request or the response. Formatters are attached to adapters the
same way adapters are attached to Listener or directelly to formatters. A formatter is also a
plugin (a .jar file) that is capable of formatting requests/responses that come to/go out of TCS.
A formatter can be a request formatter or a response formatter. A request formatter formats a
request before it reaches T24. A response formatter formats a response after it has been
processed by T24, but before being sent to the client.
TC2-TC Plugins-R10.01 5
There are certain ground rules you need follow while creating these plugins.
For the request, the SPLITTER (if any) is always invoked before the
FORMATTER.
For The response, the splitter (if any), is invoked after the FORMATTER.
A FORMATTER can always decide to cancel the call. The response will then
be sent back to the listener
TC2-TC Plugins-R10.01 6
So, what are the default plug-ins TCS loads when it starts?
Where to find these default plug-ins?
The above screen shot is taken from TCServer’s ext directory where all default plug-ins are
available.
When TCServer starts it loads all these default plug-ins if you don’t want to start any of these
plug-ins when TCServer starts just remove the relevant jar file. As you know already all plug-
ins are basically jar files.
Whenever you create your own customised plug-ins you need to copy jar file which will get
produced as a result of compilation of java code to the ext directory of TCServer. So that,
TCServer loads all of them while starting up.
Each plug-in has a java code written behind. User defined plug-ins are as well defined in
tcserver.xml as default plug-ins.
TC2-TC Plugins-R10.01 7
When starting the TCServer, the first action is to load the different available plug-ins. Here, the
load is a pure technical one. This has nothing to do with the activation. Even if you haven’t
mentioned any TCP listener in your configuration file, you will see the TCServer loading it. You
could remove the file tcplistener.jar so the TCServer won’t discover it anymore. The main
reason to be plug-in oriented is certainly because it allows :
TC2-TC Plugins-R10.01 8
You already know that TCServer’s published API allows external interfaces to talk to T24 application
server.
This API is contained inside a package called com.temenos.tocf.tcs.API. Where tocf is Temenos Open
Connectivity Framework.
Let’s see some JAVA jargans what is package, class and method.
Being a piece of java code TCServer allows to create objects with the help of this package which has five
classes organised inside namely
AbstractListener, AbstractAdapter, AbstractFormatter, AbstractSplitter and TimeStamps.
AbstractListener - This class is the class you will have to extend if you want to write a new Listener.
AbstractAdapter - This class is the class you will have to extend if you want to write a new Adapter.
AbstractFormatter - This class is the class you will have to extend if you want to write a new Formatter.
AbstractSplitter - This class is the class you will have to extend if you want to write a new Splitter.
TimeStamps – This is a class containing the different timestamps during the process of the message.
You certainly don’t need it, however, this class needs to be imported when you are writing a Listener
which handles asynchronous calls.
TC2-TC Plugins-R10.01 9
ATMLISTENER
This listener listens on a tcp port, and will process any message of a specific format coming on
this port.
BYTESLISTENER
This listener listens on a tcp port, and will process any message coming on this port. A
message has a specific format
{message_length}{message}
MQLISTENER
“bind” in native or client mode to an mqseries queue, and process all messages in this queue.
The response are pushed in a response
queue. In case of failure, use the transactional mode (rollback). Full support of RFH2 headers,
and offers some editing facilities of this last
header for the response.
SSLLISTENER
Default listener for communicating with the TCC (Client API) in a secure way.
This listener needs only one parameter : A unique TCP Port number. The certificate needed
for the ssl handshaking is in
<tcserver_dir>/lib/security/tcs.ks. The compatible certificate, at the client level is in
<tcclient_dir>/lib/security/tcc.ks
TC2-TC Plugins-R10.01 10
FILELISTENER
Process files from an input directory and write responses to a file with a different extension to an output directory. If a processing error
occurs, the request is redirected to an error directory.
JCONSRLLISTENER
Listener for communicating with T24 Desktop. This listener is used in conjunction with jConman.
Please refers to the connection manager documentation for a full solution’s description. The documentation is located in the /doc
directory and is named “jconman.pdf”
T24EVTLISTENER
This listener acts as an event server ( See the event service documentation ). The listener retrieves events sent by a publisher and
transmit it to the adapter.
BATCHFILELISTENER
Process files with request from an input directory and write responses to a file with a different extension to an output directory. The
plug-in
also maintain index files to reprocess requests in case of problems or interruptions. In case of processing errors, the erroneous
request is
redirected to an error directory.
The reason for offering a batchfilelistener is to benefits of the tcserver infrastructure, and make sure that the processing of the file is
spread over
all the available sessions of the adapter. The batch file listener is safe for being stopped/restarted. In fact, each
message in the file is stamped with a sequential number. When the response comes back, this number is stored in an index file. When
the
listener is started, and a file is found in the given directory, only the messages not being listed in the index file will be processed. When
stopping
the listener, the tcserver will wait for all message sent to the adapter to come back, but during a maximum of two minutes. This means
that if a
message is not processed in 2 minutes, there is a risk when stopped/restart, that this message will be re-processed.
TC2-TC Plugins-R10.01 11
JMSLISTENER
This listener binds to a JMS queue (via a JMS Queue Connection Factory), and process all
messages in this queue. The response are
pushed in a response queue. In case of failure, it can use the rollback mechanism (if set in
transactional mode)
RAWTCPLISTENER
This listener listens on a tcp port, and will process any message coming on this port. A
message ends with <CR>. This listener is for
test purpose only. This is just convenient to have it to test the communication. No interface
should be build on to of it.
TCPLISTENER
Default listener for communicating with the TCC (Client API). This listener needs only one
parameter : A unique TCP Port number.
TC2-TC Plugins-R10.01 12
Question
I cannot process more than one message in a single file using File Listener. Does File Listener
process only one message per file??
‘Batchfilelistener' is more suitable for a clearing file and high-volume files while the
'filelistener' is more suitable for static batch updates and not so high volumes. That said, it
should be noted that the batchfilelistener can also be used for static updates. I think the
batchfilelistener is simply an enhancement to the filelistener.
The batchfilelistener has inbuilt scalibility and duplicate checking which is very essential in the
case of a financial entry. Where the batch file contains only records that need to be updated on
a table (overwritten with the same key), you wouldnt need duplicate checking. This is because
the filelistener doesnt spawn the requests across multiple tSS sessions. It sends the requests
in only one tSS thread. The batchfilelistener sends the requests across all available tSS
threads.
TC2-TC Plugins-R10.01 13
The filelistener seems to have been built especially to process inward SWIFT messages for
STP processing - SWIFT messages come with one message per file as they contain CRLF
characters as part of the message itself.
There is request formatter which converts the CRLF into <Cr><Lf> and this is how it is
processed in SWIFT.
It makes more sense to fire high volume transactions via batch file listener using its in built
abilities to scale.
So, to summarise, use filelistener for SWIFT inward and batchfilelistener for all other feeds into
T24
TC2-TC Plugins-R10.01 14
Suppose you want pass request to T24 to enquire CURRENCY LIST twice. How you are going to achieve
this. Ok, to achieve this you need to create FORMATTER(S) first in our example since the request is an
enquiry request you need pass parameters like sign on name, password and enquiry name to the
request.
The request format should be OFS which is native message format to T24.
So, you need to supply the sign on name and password on the fly. You are going to do this with the help
of a formatter. This formatter needs to place the sign on name and password on the fly on to the request
that you have received. In other words, it has to make the messages look like
ENQUIRY.SELECT,,ALM.01/123456,
ENQUIRY.SELECT,,ALM.01/123456,
Now, if you supply the above message to TCS, you will get an error “ENQUIRY NAME NOT SUPPLIED”
You could solve this problem by creating another formatter which will place an enquiry name on the
request dynamically.
In other words, the message needs to look like this once the second formatter is also applied on the
message
ENQUIRY.SELECT,,ALM.01/123456,CURRENCY-LIST
ENQUIRY.SELECT,,ALM.01/123456,CURRENCY-LIST
Now, you must be wondering “Why can’t I create just one formatter that will place the sign on name,
password and the enquiry name on the message”?. What you think is absolutely right. Just one formatter
is sufficient to perform the above. Since we are in a learning phase, let us create and specify 2 formatters
so that you become experts in creating formatters. Well, practice makes a man perfect, isn’t?
TC2-TC Plugins-R10.01 15
Let’s understand what are the plug-ins you need to create to achieve this taks ...
You need a splitter that takes ‘+’ as a delimiter between messages and splits them
You need a formatter that will add to the REQUEST, the sign on name and password
You need a formatter that will add to the REQUEST, the name of the enquiry that is to be
executed.
TC2-TC Plugins-R10.01 16
What does the above request mean?
+ : Is the delimiter between messages. When a ‘+’ is encountered, TCS needs to understand
that there are multiple messages and split the messages. In other words, it needs to split the
message as follows
ENQUIRY.SELECT,,,
ENQUIRY.SELECT,,,
The ‘splitting’ will result in creation of 2 messages (requests in this case) and each one of them
are to be processed by T24
The above can be achieved by creating a splitter that used ‘+’ as a delimiter between
messages
TC2-TC Plugins-R10.01 17
You learnt earlier that there is a java code behind each plug-in. To help you create your own
plug-in there is a utility called TCPluginsHelper found in the bin directory of TCS.
As you know already to achieve this task you need to create plug-ins, this is the utility which will
help you with that.
TC2-TC Plugins-R10.01 18
The TCPluginsHelper requires 2 files to work.
(1) The script TCPluginsHelper.bat (or TCPpluginsHelper.sh) to start it, (it is in the folder of the
TCServer under ./bin)
(2) The Jar file tcpluginshelper.jar (under ./lib).
The permissions minimums to apply to the script have to be read and execute (rx) and read (r)
for the jar file.
The script file TCPluginsHelper.bat is located under bin directory of TCServer required read
and execute permission.
The jar file TCPluginsHelper.jar located under lib directory of TCServer required read
permission.
To start the TCPluginsHelper you have to be in the folder where the TCServer is (under ./bin
(<TCSERVER>\bin)) and execute the script TCPluginsHelper.bat (or TCPluginsHelper.sh ).
TC2-TC Plugins-R10.01 19
Create a plugins directory
Create a sub-directory named TrgFormatter1 under this
Invoke TCPluginsHelper and answer the questions that it prompts
What do you wish to create?
1. Adapter
2. Listener
3. Formatter (Choose 3)
Name of the plugin (Type TrgFormatter1)
Where is JDK installed (Example : C:\Program Files\Java\jdk1.6.0)
Where is TCServer installed (Example : c:\tcs5)
Where to create the plugin (Type the path of the TrgFormatter1 directory that you
created)
Name of the main class included in the package (Type com.temenos.TrgFormatter1)
List of parameters (Type NAME;PASSWORD )
It will now display a message “Your plugin successfully created in <Path of
TrgFormatter1 directory> “
TC2-TC Plugins-R10.01 20
Enter the mentioned code into this file
Note – ensure that the package name is temenos and not temeno (same old bug)
Change to the classes folder and open the file plugin.desc. Ensure that the package name is
spelt properly, ie:
plugin-class : com.temenos.TrgFormatter1 Note – this package name might be missing
the last alphabet. Change the name to temenos
plugin-id is the type that we need to specify in tcserver.xml when we wish to reference this
formatter
plugin-type is one of the plugin types listener/splitter/adapter/listener. In this instance formatter
plugin-class is the fully-qualified name of your class (ie. Class name prefixed by package
name)
plugin-description : Place your description of the plugin here.
plugin-configuration : The parameters that the plugin will use. These are values that we
supplied using the TCPluginsHelper
TC2-TC Plugins-R10.01 21
Execute package.bat
This will create a class file and a corresponding jar file if successful. Ensure that javac
reports no errors. The class file created by javac will be available under
c:\plugins\TrgFormatter1\classes. The jar file will be created under
c:\plugins\TrgFormatter1. This is the only file that is needed by TCS to understand
your formatter.
Note - The presence of the jar file does not guarantee that your code compiled
successfully as it is possible to have an empty jar file. Make sure that your code
compiled successfully
Copy the TrgFormatter1.jar to <Path where TCS is installed>\ext
Well, if your formatter requires some third party tools as well to work, then ensure you
place those .jar files as well under the ext directory
TC2-TC Plugins-R10.01 22
Look at the java code used to create TrgFormatter1
TC2-TC Plugins-R10.01 23
Code continues here …
TC2-TC Plugins-R10.01 24
Now, start TCS
Ensure that your formatter is loaded and your listener is up and running as well
TC2-TC Plugins-R10.01 25
Create a directory name TrgFormatter2 under the plugins directory
Invoke TCPluginsHelper and answer the questions that it prompts
What do you wish to create?
1. Adapter
2. Listener
3. Formatter (Choose 3)
Name of the plugin (Type trgFormatter2)
Where is JDK installed (Example : C:\Program Files\Java\jdk1.6.0)
Where is TCServer installed (Example : c:\tcs5)
Where to create the plugin (Type the path of the TrgFormatter2 directory that you
created)
Name of the main class included in the package (Type
com.temenos.TrgFormatter2)
List of parameters (Type ENQNAME as we wish to place the enquiry name in the
request. You may choose to give any name for the parameter)
It will now display a message “Your plugin successfully created in <Path of TrgFormatter2
directory> “
Change to the TrgFormatter2 directory. You should see the following
A directory named classes
A directory named com
With a sub folder called temenos
TC2-TC Plugins-R10.01 26
A file named package.bat
A file named package.sh
Change to com\temenos and you will find a file named TrgFormatter2.java Note – this
folder name might be missing the last alphabet due to a bug in TC. Change it to
temenos
Enter the mentioned code into this file
Change to the classes folder and open the file plugin.desc. Ensure that the package name is
spelt properly, ie:
plugin-class : com.temenos.TrgFormatter2 Note – this package name might be missing
the last alphabet. Change the name to temenos
plugin-id is the type that we need to specify in tcserver.xml when we wish to reference this
formatter (refer to the tcserver.xml settings that follow)
plugin-type is formatter as that is what we wanted to create and we chose that using the
TCPluginsHelper
plugin-class is the fully-qualified name of your class (incl package name)
plugin-description : Place your description of the plugin here.
plugin-configuration : The parameters that the plugin will use. These are values that we
supplied using the TCPluginsHelper
Open the file package.bat under c:\plugins\TrgFormatter2 and
ensure that paths with spaces are enclosed within quotes Eg: "Program Files"
add a statement pause at the end check the folder name corresponding to the package
name
Note – this name might be missing the last alphabet due to the bug in TC. Change the
name to temenos
TC2-TC Plugins-R10.01 27
Execute package.bat
This will create a class file and a corresponding jar file if successful. Ensure that javac
reports no errors. The class file created by javac will be available under
c:\plugins\TrgFormatter2\classes. The jar file will be created under
c:\plugins\TrgFormatter2. This is the only file that is needed by TCS to understand
your formatter.
Note - The presence of the jar file does not guarantee that your code compiled
successfully as it is possible to have an empty jar file. Make sure that your code
compiled successfully
Copy the TrgFormatter2.jar to <Path where TCS is installed>\ext
TC2-TC Plugins-R10.01 28
Java code used to create TrgFormatter2 …
TC2-TC Plugins-R10.01 29
Now, start TCS
Ensure that your formatter is loaded and your listener is up and running as well
TC2-TC Plugins-R10.01 30
For the scenario that we are discussing, we need to create a splitter that uses ‘+’ as a delimiter
and splits the incoming message.
Since the TCPluginsHelper does not support creation of a splitter, I suggest, to start with, copy
the folder of any one formatter and make the required changes. If you wish, you could create
one on your own.
Make a copy of the folder TrgFormatter1 and name it TrgSplitter
Ensure you set up the following directories (Change directory names as required)
plugins\TrgSplitter\com\temenos (Rename the TrgFormatter1.java to TrgSplitter.java)
plugins\trgSplitter\classes\com\temenos (Delete the trgFormatter1.class file)
plugins\trgSplitter\classes (Ensure you have the plugin.desc file)
plugins\trgSplitter (Delete the TrgFormatter1.jar file)
Enter the mentioned code into the TrgSplitter.java file (make sure you delete the existing
formatter code completely)
TC2-TC Plugins-R10.01 31
Change to the classes folder and open the file plugin.desc. Ensure that the package name is
spelt properly, ie:
plugin-class : com.temenos.TrgSplitter Note – this package name might be missing
the last alphabet. Change the name to temenos
plugin-id is the type that we need to specify in tcserver.xml when we wish to reference this
splitter plugin . (refer to the tcserver.xml settings that follow)
plugin-type is the plugin type. In this instance splitter
plugin-class is the fully-qualified name of your class (ie. Class name prefixed by package
name)
plugin-description : Place your description of the plugin here.
plugin-configuration : The parameter that the plugin will use.
Open the file package.bat under c:\plugins\TrgSplitter and
ensure that paths with spaces are enclosed within quotes Eg: "Program Files"
add a statement pause at the end check the folder name corresponding to the
package name
Note – this name might be missing the last alphabet due to the bug in TC. Change the
name to temenos
TC2-TC Plugins-R10.01 32
Execute package.bat
This will create a class file and a corresponding jar file if successful. Ensure that javac
reports no errors. The class file created by javac will be available under
c:\plugins\TrgSplitter\classes. The jar file will be created under c:\plugins\TrgSplitter.
This is the only file that is needed by TCS to understand your formatter.
Note - The presence of the jar file does not guarantee that your code compiled
successfully as it is possible to have an empty jar file. Make sure that your code
compiled successfully
Copy the TrgSplitter.jar to <Path where TCS is installed>\ext
TC2-TC Plugins-R10.01 33
Java code used to create TrgSplitter
TC2-TC Plugins-R10.01 34
Code for SPLITTER continues here.
TC2-TC Plugins-R10.01 35
Now, start TCS
Ensure that your formatters and splitters are loaded and your listener is up and running as well
TC2-TC Plugins-R10.01 36
TCS ships with a number of adapters that carry out a variety of tasks. TCS has adapters that
communicate with T24, send SMTP messages, send out bytes etc. Let us create our own
adapter that will create a file with data that it receives from a listener listening on a raw-tcp
port. This example is used just to re-enforce the working and the use of adapters in TCS.
Create a directory name TrgAdapter2 under the plugins directory
Invoke TCPluginsHelper and answer the questions that it prompts
What do you wish to create?
1. Adapter
2. Listener
3. Formatter (Choose 1)
Name of the plugin (Type TrgAdapter2)
Where is JDK installed (Example : C:\Program Files\Java\jdk1.6.0)
Where is TCServer installed (Example : c:\tcs5)
Where to create the plugin (Type the path of the TrgAdapter2 directory that you
created)
Name of the main class included in the package (Type com.temenos.TrgAdapter2)
TC2-TC Plugins-R10.01 37
List of parameters (We don’t need any parameters for this adapter as it going to
receive the request from a raw-tcp port. Leave this blank)
It will now display a message “Your plugin successfully created in <Path of TrgAdapter2
directory> “
Change to the TrgAdapter2 directory. You should see the following
A directory named classes
A directory named com
With a sub folder called temenos
A file named package.bat
A file named package.sh
Change to com\temenos and you will find a file named TrgAdapter2.java Note – this
folder name might be missing the last alphabet due to a bug in TC. Change it to
temenos
Enter the following code into this file
Note – ensure that the package name is temenos and not temeno (same old bug)
Change to the classes folder and open the file plugin.desc. Ensure that the package name is
spelt properly, ie:
TC2-TC Plugins-R10.01 38
plugin-class : com.temenos.TrgAdapter2 Note – this package name might be missing
the last alphabet. Change the name to temenos
plugin-id is the type that we need to specify in tcserver.xml when we wish to reference this
adapter
plugin-type specify the plugin type. In this instance adapter.
plugin-class is the fully-qualified name of your class (incl package name)
plugin-description : Place your description of the plugin here.
plugin-configuration : The parameter that the plugin will use. This is blank in this case
Open the file package.bat under c:\plugins\TrgAdapter2 and
ensure that paths with spaces are enclosed within quotes Eg: "Program Files"
add a statement pause at the end check the folder name corresponding to the
package name
Note – this name might be missing the last alphabet due to the bug in TC. Change the
name to temenos
Execute package.bat
This will create a class file and a corresponding jar file if successful. Ensure that javac
reports no errors. The class file created by javac will be available under
c:\plugins\TrgAdapter2\classes. The jar file will be created under
c:\plugins\TrgAdapter2. This is the only file that is needed by TCS to understand your
formatter.
Note - The presence of the jar file does not guarantee that your code compiled
successfully as it is possible to have an empty jar file. Make sure that your code
compiled successfully
Copy the TrgAdapter2.jar to <Path where TCS is installed>\ext
TC2-TC Plugins-R10.01 39
Now let us configure TCS to understand and use the new adapter that we have just created.
File Name : tcserver.xml
TC2-TC Plugins-R10.01 40
Now, start TCS
Ensure that your adapter is loaded and your listener is up and running as well
Connect to the raw-tcp port 7033 and type any text that you wish to be stored in the file
Look at the console where you have your TCS up and running and you should see a similar
message
Now, open the txt file that it has just created (in the bin folder of your TC)and check if the data
that you typed is available.
TC2-TC Plugins-R10.01 41
Test your newly created Adpater …
TC2-TC Plugins-R10.01 42
TCS comes with a number of built in listeners that can be configured to talk to the various
adapters that are already available. Let us create a new listener named TrgListener1 that is
capable of
Passing text to the adapter TrgAdapter2
Specifying number of times the data that it supplies need to be processed by TrgAdapter2
So, we if pass the text “This is from corporate training team” along with a number ‘2’ to the new
listener that we are to create, it should pass that to TrgAdapter2 and 2 files need to get created
under the bin directory of TCS.
TC2-TC Plugins-R10.01 43
Slide 43
g1 The text and ferquency are both pssed as parameters thru TCServer.xml
gerardthomas, 12/10/2007
Create a directory name TrgListener1 under the plugins directory
Invoke TCPluginsHelper and answer the questions that it prompts
What do you wish to create?
1. Adapter
2. Listener
3. Formatter (Choose 2)
Name of the plugin (Type TrgListener1)
Where is JDK installed (Example : C:\Program Files\Java\jdk1.6.0)
Where is TCServer installed (Example : c:\localhost\tc-r6umb)
Where to create the plugin (Type the path of the TrgListener1 directory that you
created)
Name of the main class included in the package (Type com.temenos.TrgListener1)
List of parameters (REQUEST;FREQUENCY)
It will now display a message “Your plugin successfully created in <Path of
TrgListener1 directory> “
Change to the TrgListener1 directory. You should see the following
A directory named classes
TC2-TC Plugins-R10.01 44
A directory named com
With a sub folder called temenos
A file named package.bat
A file named package.sh
Change to com\temenos and you will find a file named TrgListener1.java Note
– this folder name might be missing the last alphabet due to a bug in TC.
Change it to temenos
Enter the following code into this file
Note – ensure that the package name is temenos and not temeno (same old
bug)
Change to the classes folder and open the file plugin.desc. Ensure that the package
name is spelt properly, ie:
plugin-class : com.temenos.TrgListener1 Note – this package name might be
missing the last alphabet. Change the name to temenos
plugin-id is the type that we need to specify in tcserver.xml when we wish to
reference this formatter
plugin-type specify the plugin type. In this instance listener
plugin-class is the fully-qualified name of your class (incl package name)
plugin-description : Place your description of the plugin here.
plugin-configuration : The parameters that the plugin will use. This are the values
that we supplied using the TCPluginsHelper
TC2-TC Plugins-R10.01 45
Open the file package.bat under c:\plugins\TrgListener1 and
ensure that paths with spaces are enclosed within quotes Eg: "Program Files"
add a statement pause at the end check the folder name corresponding to the
package name
Note – this name might be missing the last alphabet due to the bug in TC. Change the
name to temenos
Execute package.bat
This will create a class file and a corresponding jar file if successful. Ensure that javac
reports no errors. The class file created by javac will be available under
c:\plugins\TrgListener1\classes. The jar file will be created under
c:\plugins\TrgListener1. This is the only file that is needed by TCS to understand your
listener.
Note - The presence of the jar file does not guarantee that your code compiled
successfully as it is possible to have an empty jar file. Make sure that your code
compiled successfully
Copy the TrgListener1.jar to <Path where TCS is installed>\ext
TC2-TC Plugins-R10.01 46
Java code used to create TrgListener1.
TC2-TC Plugins-R10.01 47
Next let us configure TCS to understand and use the new listener that we have just created.
File Name : tcserver.xml
TC2-TC Plugins-R10.01 48
Now, start TCS
Ensure that your listener is up and running as well
TC2-TC Plugins-R10.01 49
Now, open the txt files that have been created and check if the data that you typed is available
in both the files.
TC2-TC Plugins-R10.01 50
When you type listenerinfo at the tcs prompt, it displays a list of listeners and their statuses.
The last and the last but one column need to be set to ‘true’ for the listener that you wish to
use.
Last but one column indicates that the active flag for the listener is set to true in tcserver.xml file
Last column indicates that it is able to communicate with the port that it is configured to communicate
with. (7003 in this case)
TC2-TC Plugins-R10.01 51
When you start TCServer it loads all plugins if you notice you will understand the plug-ins
which were created earlier are listed here.
TC2-TC Plugins-R10.01 52
You have already learned about TCServer’s logging mechanism let’s see how the newly
created plug-ins gets appended inside tcslog.properties.
log4j is the logging package of Apache with log4j it is possible to enable logging at runtime
without modifying the application binary. The log4j package is designed so that these
statements can remain in shipped code without incurring a heavy performance cost. Logging
behavior can be controlled by editing a configuration file, without touching the application
binary. In TCServer’s case it is tcslog.properties.
TC2-TC Plugins-R10.01 53
Notice the highlighted plug-ins which were created earlier are all appended inside
tcslog.properties.
You can set approriate log level depends on your requirement to INFO, file or DEBUG, file or
DEBUG, console.
TC2-TC Plugins-R10.01 54
While creating plug-ins when you execute package.bat javac compiles the java code which in
turn produces .jar and .class files.
The presence of the jar file does not guarantee that your code compiled successfully as it is
possible to have an empty jar file. Make sure that your code compiled successfully
To use javac make sure environment variables JAVA_HOME and PATH are set.
Javac -d <directory> <Specify where to place generated class files> -classpath <Specify
where to find user class files and
annotation processors><path to tcserver.jar> <path to *.java file>
TC2-TC Plugins-R10.01 55
In this learning unit/course, you learnt,
•Define plug-in
•Types of plug-ins
•Default plug-ins
• Plug-in oriented TCServer Architecture
•User defined plug-ins
TC2-TC Plugins-R10.01 56
TC2-TC Plugins-R10.01 57