RE: Docs/examples for JSAdapter

2013-10-22 Thread Rick Bullotta
PM To: nashorn-dev@openjdk.java.net Subject: Re: Docs/examples for JSAdapter Rick, have you considered writing a wrapper library in pure JavaScript over the harsher Java-written API? Users won't even have to know that Java is being called behind the scenes. It's much more natural to write

Re: Docs/examples for JSAdapter

2013-10-22 Thread Tal Liron
Rick, have you considered writing a wrapper library in pure JavaScript over the harsher Java-written API? Users won't even have to know that Java is being called behind the scenes. It's much more natural to write such things in JavaScript, and it would also be more portable to other JS engines

RE: Docs/examples for JSAdapter

2013-10-22 Thread Rick Bullotta
-Original Message- From: nashorn-dev-boun...@openjdk.java.net [mailto:nashorn-dev-boun...@openjdk.java.net] On Behalf Of Rick Bullotta Sent: Tuesday, October 22, 2013 12:54 PM To: Attila Szegedi Cc: nashorn-dev@openjdk.java.net Subject: RE: Docs/examples for JSAdapter Cool. Any examples out th

RE: Docs/examples for JSAdapter

2013-10-22 Thread Rick Bullotta
PM To: nashorn-dev@openjdk.java.net Subject: Re: Docs/examples for JSAdapter It is possible to subclass jdk.nashorn.api.scripting.JSObject by an arbitrary Java class. Such a class will be linked by a special dynalink linker. Script can do normal obj.foo, obj.bar() etc. and these would be rout

Re: Docs/examples for JSAdapter

2013-10-22 Thread A. Sundararajan
legant, and GREATLY simplifies the user's experience. From: Jim Laskey (Oracle) [mailto:james.las...@oracle.com] Sent: Tuesday, October 22, 2013 12:34 PM To: Rick Bullotta Cc: nashorn-dev@openjdk.java.net Subject: Re: Docs/examples for JSAdapter In Nashorn, there is no need to wrap classe

RE: Docs/examples for JSAdapter

2013-10-22 Thread Rick Bullotta
- From: Attila Szegedi [mailto:attila.szeg...@oracle.com] Sent: Tuesday, October 22, 2013 12:51 PM To: Rick Bullotta Cc: A. Sundararajan; nashorn-dev@openjdk.java.net Subject: Re: Docs/examples for JSAdapter You should be able to use your own subclasses of jdk.nashorn.api.scripting.JSObject for this

Re: Docs/examples for JSAdapter

2013-10-22 Thread Attila Szegedi
ther trivial, to be honest. > > > -Original Message- > From: nashorn-dev-boun...@openjdk.java.net > [mailto:nashorn-dev-boun...@openjdk.java.net] On Behalf Of A. Sundararajan > Sent: Tuesday, October 22, 2013 12:33 PM > To: nashorn-dev@openjdk.java.net > Subject: Re:

RE: Docs/examples for JSAdapter

2013-10-22 Thread Rick Bullotta
33 PM To: nashorn-dev@openjdk.java.net Subject: Re: Docs/examples for JSAdapter No. Nashorn uses wrapperless Java objects. Java objects are exposed to scripts "as is" - no wrapping as 'script objects' as in Rhino. It is possible to implement Java interfaces in script (j

RE: Docs/examples for JSAdapter

2013-10-22 Thread Rick Bullotta
ce. From: Jim Laskey (Oracle) [mailto:james.las...@oracle.com] Sent: Tuesday, October 22, 2013 12:34 PM To: Rick Bullotta Cc: nashorn-dev@openjdk.java.net Subject: Re: Docs/examples for JSAdapter In Nashorn, there is no need to wrap classes/types in JavaScript objects. You can work with them directly

Re: Docs/examples for JSAdapter

2013-10-22 Thread Jim Laskey (Oracle)
gister custom adapters in a “wrap factory” that tells the > script engine to use these adapters for accessing instances of those > classes/types. What’s the analog in Nashorn? Can custom types implement > interfaces that Nashorn will use? > > From: Jim Laskey (Oracle) [mailto:j

Re: Docs/examples for JSAdapter

2013-10-22 Thread A. Sundararajan
m Laskey (Oracle) [mailto:james.las...@oracle.com] Sent: Tuesday, October 22, 2013 11:52 AM To: Rick Bullotta Cc: nashorn-dev@openjdk.java.net Subject: Re: Docs/examples for JSAdapter In general the Nashorn docs start here. https://wiki.openjdk.java.net/display/Nashorn/Nashorn+Documentation, but as yo

RE: Docs/examples for JSAdapter

2013-10-22 Thread Rick Bullotta
ailto:james.las...@oracle.com] Sent: Tuesday, October 22, 2013 11:52 AM To: Rick Bullotta Cc: nashorn-dev@openjdk.java.net Subject: Re: Docs/examples for JSAdapter In general the Nashorn docs start here. https://wiki.openjdk.java.net/display/Nashorn/Nashorn+Documentation, but as you point out

Re: Docs/examples for JSAdapter

2013-10-22 Thread Jim Laskey (Oracle)
In general the Nashorn docs start here. https://wiki.openjdk.java.net/display/Nashorn/Nashorn+Documentation, but as you point out, we seem to be lacking JSAdapter details. I should start an FAQ. From the javadoc (cd make; ant javadoc # ./dist/javadoc/index.html) public final class NativeJSAdap