File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\ui-samples-plugin\src\main\java\jenkins\plugins\ui_samples\JavaScriptProxy.java.html

1 package jenkins.plugins.ui_samples;
2
3 import hudson.Extension;
4 import org.kohsuke.stapler.bind.JavaScriptMethod;
5
6 /**
7 * "Export" Java objects to JavaScript in the browser as a proxy object, so that
8 * you can make ajax-calls to the server later.
9 *
10 * @author Kohsuke Kawaguchi
11 */
12 @Extension
13 public class JavaScriptProxy extends UISample {
14 private int i;
15
16 @Override
17 public String getDescription() {
18 return "Use JavaScript proxy objects to access server-side Java objects from inside the browser.";
19 }
20
21 /**
22 * The annotation exposes this method to JavaScript proxy.
23 */
24 @JavaScriptMethod
25 public int increment(int n) {
26 return i+=n;
27 }
28
29 @Extension
30 public static final class DescriptorImpl extends UISampleDescriptor {
31 }
32 }
33