JEXIT Examples
class :
package com.ibm.websphere.dtx.test;
public class TestJExit {
Person person = new Person();
public TestJExit() {
}
public String toUpper(String test) {
return test.toUpperCase();
}
public String Concat(String test1, String test2) {
return test1 + test2;
}
public Integer toNumber(String test1) {
return new Integer(test1);
}
public Double toDouble(String test1) {
return new Double(test1);
}
public void toNothing() {
}
public int returnint() {
return 9;
}
public byte returnbyte() {
return 8;
}
public Person getPerson() {
return person;
}
}
class :
package com.ibm.websphere.dtx.test;
public class Person{
private String ext = new String("DTX");
private String name = new String("Websphere");
public Person() {
}
public String getName() {
return name;
}
public String getExt() {
return ext;
}
}
Simple primitive types and simple objects
- JEXIT ("com.ibm.websphere.dtx.test.TestJExit " , "toUpper" , "HCL")
Returns HCL
- JEXIT ("com.ibm.websphere.dtx.test.TestJExit" , "Concat" , "HCL Transformation", " Extender")
Returns HCL Transformation Extender
- JEXIT ("com.ibm.websphere.dtx.test.TestJExit" , "toDouble" , "12")
Returns 12.0
- JEXIT ("com.ibm.websphere.dtx.test.TestJExit" , "toNumber" , "12")
Returns 12
- JEXIT ("com.ibm.websphere.dtx.test.TestJExit" , "returnint")
Returns 9
- JEXIT ("com.ibm.websphere.dtx.test.TestJExit" , "returnbyte")
Returns 8
Complex objects
When the function is returning a complex object, the returning object is added to the object pool and the key is returned to the map rule.- JEXIT ("com.ibm.websphere.dtx.test.TestJExit " , "getPerson")
Returns a key (as a string)
- JEXIT ("key" , "getName")
Returns Websphere
- JEXIT ("key" , "<destroy>")
Deletes the Person object from the JVM memory. The "<destroy>" method must be invoked before the map completes processing.