On Jan 31, 11:12 am, [EMAIL PROTECTED] wrote: > Hello, > > Is it possible to expose a script's functions as methods of the class > when compiling Javascript to a Java class? If yes, how? > > Reason: > > I would like to use Javascript functions as SQL functions within Oracle > triggers, avoiding recoding these in PL/SQL. Oracle allows for public > methods within Java classes to be used for this purpose. > > I am able to compile the Javascript using jsc but the functions are not > directly (as far as I can tell) available from Java. > > Thanks, > -Edwin S. Ramirez-
If you create a Java interface with the methods you want to expose, then you can create a JavaAdapter in Rhino. The JavaAdapter can then be used to have JavaScript objects implement the interface you defined, and calls to that interface's methods will be resolved to functions in your object. --N _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
