title: Calling a Java Method from the native code using jni
body: <p>I am new at using JNI. I successfully write a few programs that call native methods written in c.</p>
  
  <p>Now I need my java code to be called by the native code side after it is initialized. Is it possible?
  Until now, I tried some kind of polling techniques. That is, I check native code parameters from my java code periodically, but if there is a way that native code can send some kind of interrupt it could be more efficient. Is it possible? Or can you suggest a better way than polling?</p>
  
  <p>Note:
   When I search for "Call Java Functions from C Using JNI" all the answers I get is like</p>
  
  <p><a href="http://www.codeproject.com/Articles/22881/How-to-Call-Java-Functions-from-C-Using-JNI" rel="noreferrer">http://www.codeproject.com/Articles/22881/How-to-Call-Java-Functions-from-C-Using-JNI</a></p>
  
  <p><a href="https://stackoverflow.com/questions/14955584/jni-call-java-method-from-c-program">JNI Call java method from c program</a></p>
  
  <p>Those examples is not an answer for my situation. Because my main program is in java, and what I ask is that: Can the native functions(written in c) that I call from java code call some other java functions under certain circumstances? Is it possible to manage this without using a polling technique like I mentioned above? </p>