title: Pass Java Callback Function to JSNI Method?
body: <p>I want to pass a success and a failure callback Java function to a JSNI method.</p>
  
  <p><strong>This is what I get so far but it does not work. How can I fix it?</strong></p>
  
  <pre><code>package c;
  
  public class A {
  
  test(new Callback&lt;String, String&gt;() {
  
      @Override
      public void onFailure(String reason) {
          Window.alert("fail");
      }
  
      @Override
      public void onSuccess(String result) {
          Window.alert("suc");
      }
  });
  
  
  native void test(Callback&lt;String, String&gt; callback) /*-{
  
    var callback = $entry(function(event) {
       callback.@c.A.Callback::onSuccess(Ljava/lang/String;)("success!");
    });
  
  }-*/;
  
  }
  </code></pre>