• 1 reply
  • Latest Post - ‏2012-05-20T08:46:22Z by SystemAdmin
570 Posts

Pinned topic Developing Adapters in Java

‏2012-05-16T16:15:52Z |
Is it possible to create worklight adapters in Java? In one of the worklight sessions, we were told that it is possible to do it so. Can you please share the steps for that?
  • SystemAdmin
    570 Posts

    Re: Developing Adapters in Java

    Hello AppsRN.

    Worklight adapters are written in JavaScript (and XML).

    Worklight uses Rhino as the engine for running the JavaScript script used to implement adapter procedures.
    Rhino is an open source JavaScript container developed by Mozilla.
    In addition to being part of Java 6, Rhino has two other advantages:
    • It compiles the JavaScript code into byte code, which runs faster than interpreted code.
    • It provides access to Java code directly from JavaScript. For example:
    var date = new java.util.Date();
    var millisec = date.getTime()
    And this is how you can use Java inside your adapter.