how to call methods defined in another class ? is it possible?
Hi all,
I am new to using JNI, was wondering if this is possible and how I might be able to do this. I'm trying to call some set/get functions defined in a class that is not part of the class where I have my native code defined and called...
Let me explain a bit, I have a class JobElement (singular Job) that stores all the data associated with a Job, such as job name, job id, etc.
Another class JobsElement (plural Jobs) contains all the Jobs that are currently running.
The code is set up something like this...
class JobElement{
String jobID;
String jobName;
publicvoid setJobId(String newJobID){ jobID = newJobID;}
publicvoid setJobName(String newJobName){ jobName = newJobName;}
...
}
class JobsElement{
Date timeDateStamp;
JobElement job;
}
class AppRoot{
JobsElement allJobs =null;
JobElement _currentJob =null;
publicnative getAllJobs();
...
}
In my native method, getAllJobs(), I essentially want to call the set functions that are defined for JobElement when filling in the information of the Job. (then finally add the JobElement to the JobsElement list)
In summary, I basically want to know if it's possible to call the equivilent of this java code from the native code?
_currentJob.setJobName(newJob)
In the native code I tried to find the setJobID method but got a NoSuchMethodError. (which is what I expected)
Thanks in advance.

