Platform Framework
R24 AMR | Min(s) read

TAFJEE Entry Points

TAFJEE provides entry points to process OFS requests, invoke routines with parameters and trigger background program execution. This section provides details about the synchronous and asynchronous entry points in TAFJEE.

TAFJEE provides entry points in two ways:

  • Synchronously by doing a Webservice or EJB invocation with TAFJClient API.
  • Asynchronously by sending a JMS message with a JMS client or by using CALLJEE statement.
For details on how to interact with TAFJJEE, refer http://localhost:8080/TAFJEE/html/interaction.html

Synchronous Invocation

The two different entry points to synchronously process OFS requests and call routines from a client application are Webservices and EJB. Although both the methods can be used with TAFJClient API at ease, EJB invocation requires a bit more configuration and deployment knowledge.

The TAFJJEEClientFactory is the entry point to get a TAFJJEEClient for both Webservice and EJB invocation.

package com.temenos.tafj.jee.client;
		
public class TAFJJEEClientFactory 
	
public static TAFJJEEClient getWebServiceClient(String hostname, String port)
	
public static TAFJJEEClient getEjbClient(AppServerProvider appServer, String hostname, String port)

The TAFJJEEClient is the interface, which provides methods to process an OFS request, to call a subroutine or process a tRun invocation.

package com.temenos.tafj.jee.client;

public interface TAFJJEEClient 
   
String[] callAt(String routineName, String[] parameters);
  
String processOFS(String request);

TRunCallObject trun(TRunCallObject parameter);

The AppServerProvider is an enumeration used by the factory to retrieve the EJB client corresponding to the application server version. As a helper, it also defines ports which are usually used by default for HTTP request and EJB lookup.

package com.temenos.tafj.jee.client;

public enum AppServerProvider 

WEBLOGIC("7001", "7001"), //Weblogic 12.2
WEBSPHERE("9080", "2809"), //Websphere 9 
JBOSS7EAP("8080","8080"); //JBoss EAP 7 

private final String defaultHttpPort;
private final String defaultEJBPort;

Asynchronous Invocation

JMS can be used to process OFS request and invoke subroutine asynchronously. TAFJ is shipped with a standalone application—JMSInjector, which provides certain utilities to send and receive messages.

The following section provides code sample to write a simple JMS client application. As the code parts related to the JMS resources lookup are application server specific, certain changes may be required to suit the application server versions.

The client application classpath must contain the application server client libraries to process the JMS resources lookup.

The main purpose of the above sample is to describe the JMS client behavior:

  • Lookup the JMS resources from the initial context.
  • Get a JMS connection through the ConnectionFactory.
  • Create a JMS session.
  • Create a MessageProducer to send message to the targeted queue.
  • Send the OFS request or invoke the subroutine by creating a Text message.
  • Eventually create a Message Receiver to receive a response.

Copyright © 2020- Temenos Headquarters SA

Published on :
Monday, May 27, 2024 5:10:17 PM IST