What is the most efficient way to access java methods from c++
<p>Clearly one could use the java JNI, but would accessing the methods through web services be potentially faster?</p>

<p>The methods that concern me the most are the iterative methods, where <em>objects</em> in an array are serially accessed. In C++ the loop is:</p>

<pre><code>for (int i = 0; i &lt; n; ++)
    get ith object from java // JNI or web service call?
</code></pre>