0% found this document useful (0 votes)
45 views11 pages

Java Multithreading Service Hooks Guide

The document outlines a workshop on creating a multithreaded service in Java that prints customer names and IDs using hooks in T24. It includes instructions for implementing the ServiceLifecycle interface, writing Java code for the service, and setting up the environment in jBoss. The expected output is a display of customer information filtered by language criteria.

Uploaded by

prakashangadi262
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views11 pages

Java Multithreading Service Hooks Guide

The document outlines a workshop on creating a multithreaded service in Java that prints customer names and IDs using hooks in T24. It includes instructions for implementing the ServiceLifecycle interface, writing Java code for the service, and setting up the environment in jBoss. The expected output is a display of customer information filtered by language criteria.

Uploaded by

prakashangadi262
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Java Extension Multithread Workshop:-Service Hooks in Java

1)Write a Multithread Routine To print Customer Name and Customer Id By using Hooks
Services in java
Services in T24

• Multithreaded processes

• Must implement [Link]

• Equivalent of LOAD – initialize() SELECT – getIds() or getTableName() RECORD – process() or


inputRecord()

DEMO- Service Simple Service that displays the Customer ID and Customer Name, where the
Language should be “1”

Excepted Output:-

[Link] Record for [Link]


Create Project

Create Package

Create the class

And Write below java code


package [Link];

import [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

public class MultiService extends ServiceLifecycle {


DataAccess yDataAccess = new DataAccess(this);
@Override
public List<String> getIds(ServiceData serviceData, List<String>
controlList) {
// TODO Auto-generated method stub
CompanyRecord yCompRec = new CompanyRecord(this);
List<String> idList = null;
String yCompMne = [Link]().getValue();
idList = [Link](yCompMne, "CUSTOMER", "", "WITH
LANGUAGE EQ '1'" );
return idList;
}

@Override
public void initialise(ServiceData serviceData) {
// TODO Auto-generated method stub
[Link]("Customer List");
}

@Override
public void process(String id, ServiceData serviceData, String
controlItem) {
// TODO Auto-generated method stub
String yCustId =id;
CustomerRecord yCustRec = new
CustomerRecord([Link]("CUSTOMER", yCustId));
String yCustName = yCustRec.getName1().toString();
[Link]("Customer Id :" + yCustId );
[Link]("Customer Name :" + yCustName );
}

}
• Create the JAR.

• Add the JAR to the jBoss [Link] and restart jBoss


[Link]
[Link]
I,
Make Entry in BATCH

Make Entry in TSS


Note: While running service – [Link] should be Start
Run the Services

You might also like