Skip to content

Commit 35a6b4c

Browse files
committed
basic instructions
1 parent c4858c7 commit 35a6b4c

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

README

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
This is a port of the JavaScript browser front end for jabsorb (http://jabsorb.org) to nodeJS.
3+
4+
jabsorb is a very simple and flexible framework for directly calling java methods in a remote
5+
JVM and serializing/deserializing the associated java objects over the wire using JSON-RPC.
6+
7+
See test.js for a very simple working example.
8+
See http://jabsorb.org for more information on using jabsorb.
9+
10+
example usage:
11+
12+
// pull in jabsorb client
13+
var nodejava=require('./jabsorb');
14+
15+
// create jabsorb (json-rpc) client for talking to Java
16+
var java = new nodejava.client("http://your-url-to-jabsorb-server");
17+
18+
// pick the compressors we want to use
19+
var compressors = {javaClass: "java.util.HashSet", set:{"Noop":"Noop", "JSMin":"JSMin", "gzip":"gzip"}};
20+
21+
// call the remote Java server via json-rpc
22+
java.exposedObject.methodCall(
23+
24+
// call back function
25+
// r is result, e is exception
26+
function(r, e)
27+
{
28+
if (r && !e)
29+
{
30+
console.log ("got a result!");
31+
console.log ("result: " + JSON.stringify(r));
32+
}
33+
else
34+
{
35+
console.log("exception occured:");
36+
console.log("exception: " + JSON.stringify(e));
37+
}
38+
}, argsGoHere, arg2, arg3, etc);
39+
40+

test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// pull in jabsorb client
12
var nodejava=require('./jabsorb');
23

34
// create jabsorb (json-rpc) client for talking to Java

0 commit comments

Comments
 (0)