Description
I have a ballerina program. I will compile it and generate a jar file. Then I will add that jar as dependency to another Java Project. Then I need to start the ballerina program from the external Java Project and call the functions.
Describe your problem(s)
No response
Describe your solution(s)
Provide an Runtime API as below.
import io.ballerina.runtime.api.Runtime;
Runtime balRuntime = Runtime.start(“org”, “module”, 1.0.0);
Object[] args = [];
balRuntime.invokeMethodAsync(“myFunction”, args, callback);
Runtime.stop(“org”, “module”, 1.0.0);
Runtime Class
Class initClass;
public static void start(String orgName, String moduleName, String version) {
String initClassName = orgNAme + “$” + moduleName + “$” + version
initClass = Class.load(initClassName);
Scheduler s = new Scheduler();
s.schedule(moduleInitFunction);
initClass.invoke(“moduleInit”);
}
public static void stop(String orgName, String moduleName, String version) {
initClass.invoke(“moduleStop”);
}
Related area
-> Runtime
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
Description
I have a ballerina program. I will compile it and generate a jar file. Then I will add that jar as dependency to another Java Project. Then I need to start the ballerina program from the external Java Project and call the functions.
Describe your problem(s)
No response
Describe your solution(s)
Provide an Runtime API as below.
Runtime Class
Related area
-> Runtime
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response