Skip to content

a simple interface to Java for nodeJs over jabsorb/json-rpc

Notifications You must be signed in to change notification settings

arthurblake/nodeJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a port of the JavaScript browser front end for jabsorb (http://jabsorb.org) to nodeJS.

jabsorb is a very simple and flexible framework for directly calling java methods in a remote 
JVM and serializing/deserializing the associated java objects over the wire using JSON-RPC.

See test.js for a very simple working example.
See http://jabsorb.org for more information on using jabsorb.

example usage:

// pull in jabsorb client
var nodejava=require('./jabsorb');

// create jabsorb (json-rpc) client for talking to Java
var java = new nodejava.client(["serverObjRef.serverMethodName", "exposedObject.methodCall", "etc.etc"], "http://your-url-to-jabsorb-server");

// call the remote Java server via json-rpc
java.exposedObject.methodCall(

  // call back function
  // r is result, e is exception
  function(r, e)
  {
    if (r && !e)
    {
      console.log ("got a result!");
      console.log ("result: " + JSON.stringify(r));
    }
    else
    {
      console.log("exception occured:");
      console.log("exception:  " + JSON.stringify(e));
    }
  }, argsGoHere, arg2, arg3, etc);

limitations:

At this time, only asychronous calls are supported (But you shouldn't be doing synchronous calls anyway, right?)
Also, there is no support for SSL.
Both of these are limitations of the XHR port that is being used (see http://github.com/arthurblake/node-XMLHttpRequest).

About

a simple interface to Java for nodeJs over jabsorb/json-rpc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published