Appendix B. Source code for Trade6 user programs and script files for Linux on POWER 357
//EX.
WebSphere:cell=myNode01Cell,node=myNode01,server=server1+WebSphere:cell=myNode01Cell,node=w
ebserver1_node,server=webserver1
String value = "";
int moduleStart = 0, moduleEnd = 0, serverStart = 0, serverEnd = 0, totalLength = 0,
previousLineLength = 0, sourcePointer = 0;
String[] lines = source.split("\n");
for (int i = 0; i< lines.length; i++)
{
if (-1 != lines[i].indexOf(URILABEL))
{
if ((0 != i) && (i + 1 < lines.length))
{
moduleStart = totalLength;
moduleEnd = moduleStart + lines[i-1].indexOf(":") + 1;
serverStart = totalLength + lines[i-1].length() + 1 + lines[i].length()
+ 1;
serverEnd = serverStart + lines[i+1].indexOf(":") + 1;
if(0 != sourcePointer)
{
value += source.substring(sourcePointer, moduleStart);
}
value += MODULELABEL;
value += source.substring(moduleEnd, serverStart);
value += SERVERLABEL;
sourcePointer = serverEnd;
}
}
totalLength += previousLineLength;
previousLineLength = lines[i].length() + 1; // Add one for new line character
}
value += source.substring(sourcePointer, source.length());
return (value);
}
}
The CheckAppInstall.jacl script file
Example B-6 is a sample CheckAppInstall.java file which was used for deploying the Trade6
application.
Example: B-6 CheckAppInstall.jacl script
# %I% %W% %G% %U%
# **************************************************************
# CheckAppInstall will list all installed apps and put out
# the text APP_EXISTS if the application name in the arg is found or
# the text APP_DOES_NOT_EXIST if the application name is not found
# One arg is expected, the name of the application
global AdminApp
global env
set appList [$AdminApp list]

Get IBM Express Runtime V2.1 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.