Problem:
- Product Name: VisiBroker for Java
- Product Version: 5.2, 8.x
- Product Component: IREP
- Platform/OS Version: All
How to start irep from within a Java application?
Resolution:
The following code demonstrates how to startup irep inside a JAVA application.
package testirep;
import com.inprise.vbroker.compiler.tools.tool;
class Startup {
/* Method to startup any JAVA based tool */
static void startTool(String[] args)
{
System.err.println("Called for " args[0] " !");
com.inprise.vbroker.compiler.tools.tool.main(args);
}
/* Test this method through process startup */
public static void main(String[] args)
{
Startup.startTool(args);
}
};
It consists of two static functions:
(a) startTool, which starts tools using arguments passed in.
** This is the function that can be copied into the Application code and the
** incoming parameter array can be replaced with "hardcoded" values.
(b) main, which starts the above function with the parameters given on the command line.
** This can be used to explore the correct arguments. However,
** this type of startup is exactly used by the "irep.exe" and the equivalent scripts
** on UNIX boxes.
To test this:
1. Compile this code:
"vbjc testirep/Startup.java" for 5.2
"vbjc -VBJaddJar vbdev.jar testirep/Startup.java" for 8.x
2. To start the irep do:
"vbj testirep/Startup irep -fe com.inprise.vbroker.ir.irep" for 5.2
"vbj -VBJaddJar vbdev.jar testirep/Startup irep -fe com.inprise.vbroker.ir.irep" for 8.x
After initialization, the IREP tool should be up and running. Other tools like idl2ir can also be started in a similar manner.
[Internal cc: 518758]
#Security
#VisiBroker




