Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
TAFC CALLJEE
And
Version No.
2.0
Version
Date
21 November 2013
TAFC CALLJEE
Document Owner
This document is subject to change control. Each change must be agreed, annotated and signed by
the owners of the document listed below: The owners of this document are listed below:
TEMENOS
Helpdesk Manager
Sriraman Ganesan
Revision History
Version
Revision Date
Revision Description
Author
1.0
12 Apr 2010
Sheryl Rahman
1.1
21 Nov 2013
Sheryl Rahman
Date
TEMENOS Authorization
Client Authorization
1.0
2010-04-12
TAFC CALLJEE
Introduction
This document aims to explain how to deploy Message Driven Beans (MDBs), a special type
of Enterprise Java Beans (EJBs) which utilizes the inbound connection feature of the TAFC
Resource Adapter. It can be invoked from a jBC program using the CALLJEE or JEEActivate
functions and enables T24 applications to place messages on JMS queues. These remote
calls are achieved by using a TCP/IP connection from the TAFC process to a Java Enterprise
Edition Application Server such as JBoss. The only configuration necessary in TAFC is a
host and a port.
2010-04-12
TAFC CALLJEE
ejb-jar.xml - This is the standard EJB deployment descriptor, declaring the available
enterprise beans, their logical names, interfaces, and other deployment properties
(security, transactions, etc.).
jboss.xml - This optional file is used to specify a different JNDI name for a bean's
home interface. The default JNDI name for a bean is the ejb-jar.xml ejb-name
element value.
jaws.xml - This file is necessary only for CMP entity bean deployment.
Deployment Process
Ultimately, enterprise beans are packaged in a JAR file with the appropriate XML files in the
META-INF folder. Most J2EE app servers require the deployment of an EJB JAR within a WAR
file, and even within an EAR file. The process of packaging up an enterprise bean with
deployment descriptors into a larger archive with its deployment descriptors can become
rather complex. This process may be necessary in a production environment, but in
development, you need quick, efficient deployment. JBoss provides the best of both worlds.
All you do to deploy EJBs in JBoss is drop the archive into the deploy directory. The JBoss
engine immediately inspects the contents of the archive and attempts to deploy the bean(s).
Undeploying is as easy as deleting the archive from the deploy directory.
To access the bean so created we will have to write the client code. Let us try to understand
this using a simple example. Our T24 program will communicate to the MDB that prints a
message to standard output and returns an All OK response to the basic program if
everything goes well. CALLJEE is the TAFC statement that we use to invoke EJB from our T24
basic routine/ program.
2010-04-12
TAFC CALLJEE
JREMOTE_INBOUND_HOST=<host>
JREMOTE_INBOUND_PORT=<port>
Used to connect to the JEE application server are still supported for backwards
compatibility. In order to provide connectivity and failover to secondary servers, application
developers were required to use the JEEOpen/JEEActivate/JEEClose statements, manage
connection handles and optionally provide a retry mechanism for failover.
New environment variables
are now available to provide the jBC CALLJEE statement with connectivity to multiple
servers.
This mechanism
Does NOT load balance requests between multiple servers. CALLJEE establishes only
one connection to a single application server.
CALLJEE always attempts to first establish a connection to host 1 if available,
otherwise to host2, and so on.
CALLJEE does not fail-over at runtime a JBC application needs to provide the retry
mechanism, i.e. re-send the request in case of failure. See CALLJEE error codes for
identifying connection errors.
Enhanced high availability for JEE inbound connections
The inbound listener now uses the TOCF framework library (tocfframework.jar) which
provides an enhanced event pipeline based on the Netty serialization library.
Note: The Netty library - included in TOCF(EE) pack (R12.0.0.2 onwards) - must be made
available to the application servers system classloader in case the application server does
not already ship this library. This is only required when enabling the inbound listener.
2010-04-12
TAFC CALLJEE
Make sure you have the attached netty library inside <profile>\lib location.
For eg: D:\R12.GA.ModelBank.Win64.SCU\Temenos\ModelBankR12\3rdParty\jboss\server\default\lib
Ensure inbound listener is configured inside the resource adapter (tocfT24rara.rar). Enable the port as shown below:
<resourceadapter>
<resourceadapterclass>com.temenos.tocf.t24ra.T24ResourceAdapter</resourceadapter-class>
<!-- Inbound listener properties -->
<config-property>
<description>Inbound listener server name (empty = bind to all
addresses)</description>
<config-property-name>listenHost</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<!-<config-property-value>10.92.7.91</config-property-value> -->
</config-property>
<config-property>
<description>Inbound listener port number (0 = inbound listener
disabled)</description>
<config-property-name>listenPort</config-property-name>
<config-property-type>java.lang.Integer</config-property-type>
<!-- Inbound listener is disabled by default (port=0). Set to e.g. 55006 to enable
inbound listener -->
<config-property-value>55006</config-property-value>
</config-property>
CALLJEE Error Codes
0
1
2
3
4
101
102
Action successful
Connection error (i.e. connection error between T24 and App server)
Transaction error (i.e. transaction related error)
Error attempting to close a connection while a transaction is active
Activation error (i.e. endpoint is not activated or is unable to process request)
Invalid host
Invalid port
2010-04-12
TAFC CALLJEE
The Programs
PROGRAM TEST_PRINT_MESSAGE
INCLUDE JBC.h
TRANSTART ELSE CRT "Unable to start the transaction."
ACTIVATION = "PRINTMESSAGE"
INFO = "Hello folks!"
ERROR.CODE = CALLJEE (ACTIVATION,INFO)
CRT ERROR.CODE
CRT "response received: >>>>":INFO:"<<<<"
TRANSEND ELSE CRT "Unabel to commit the transaction."
2010-04-12
TAFC CALLJEE
Dissection of myMessageBean.java
The MDB class must implement the javax.jms.MessageListener [or use the Temenos
supplied JRemoteMessageListener] and the javax.ejb.MessageDrivenBean interfaces. In
addition to the onMessage method, the following must be implemented:
2010-04-12
TAFC CALLJEE
}
The JDynArray is a jBASE type that implements a dynamic string array where attribute,
value, and subvalue delimiters mark the array indices. On successful creation of a
transactional context and arrival of a message thereafter, the method returns a response of
type jDynArray to the caller.
Deployment descriptors
Jboss.xml:
2010-04-12
TAFC CALLJEE
Ejb-jar.xml:
Multiple instances of the MDBs can be created in the ejb-jar.xml to receive requests for
different activation types. The jBC program can determine which MDB instance it needs to
call by the ACTIVATION string. The ACTIVATION string that we use in our test program is
PRINTMESSAGE specify it under the <activation-config-property-value> tag.
The other thing that needs to be taken care here is the ejb-name (matched in jboss.xml).
2010-04-12
TAFC CALLJEE
OUTPUTS
JBOSS Console - during deployment:
2010-04-12
TAFC CALLJEE
References
Temenos knowledge base http://knowledgebase.temenosgroup.com/
Java JDK http://java.sun.com
J2EE Connector Architecture (JCA) Specification http://java.sun.com/j2ee/connector/
JBoss http://www.jboss.org/
JBoss JTA Programmers guide
http://labs.jboss.com/jbosstm/docs/4.2.3/manuals/html/jta/ProgrammersGuide.html
2010-04-12