API design

2009-05-18 Thread Daryl Stultz
. Is there some way to take advantage of Rhino/JavaScript, ScriptableObject, etc. to achieve my goal? It seems like this design problem would be pretty common to anyone designing a JavaScript API for a Java application. Thanks for the help. -- Daryl Stultz _ 6

Re: API design

2009-05-19 Thread Daryl Stultz
On Mon, May 18, 2009 at 11:12 AM, Daryl Stultz da...@6degrees.com wrote: Hey all, I've had some basic JS extensions to my application in place for some time now. It's time to get serious about building a proper API for my application. In the event that my first post was too verbose

Re: Installation for use on command line

2009-09-08 Thread Daryl Stultz
to expose to JavaScript, this probably isn't the project for you. Maybe you should look for a different JavaScript interpreter. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com

Re: Calling Java CLI programs through Rhino

2009-10-28 Thread Daryl Stultz
, return new data, etc. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech-js-engine-rhino mailing list dev-tech-js-engine-rhino@lists.mozilla.org https

Re: Fw: Error handling - Help required !!

2009-12-16 Thread Daryl Stultz
the e object ? What does that mean? You printed the e object, didn't you? what is the type of e object ? JS objects don't really have a type in the was Java objects do. Again, what is your goal? -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc

Re: Fw: Error handling - Help required !!

2009-12-18 Thread Daryl Stultz
to JS e Object in following js script. But I don't understand this. Can you give more details of why you need it and how you will use it once you get it. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da

Re: Host object vs wrapped

2009-12-29 Thread Daryl Stultz
. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech-js-engine-rhino mailing list dev-tech-js-engine-rhino@lists.mozilla.org https

Re: Host object vs wrapped

2009-12-29 Thread Daryl Stultz
On Tue, Dec 29, 2009 at 1:46 PM, Mark Storer mstorer3...@gmail.com wrote: On Tue, Dec 29, 2009 at 5:29 AM, Daryl Stultz da...@6degrees.com wrote: I do appreciate the annotations approach to writing host objects but it's actually off topic from my original post. I disagree. Observe

Re: Fwd: Host object vs wrapped

2009-12-29 Thread Daryl Stultz
for a method/function though. Any ideas? -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech-js-engine-rhino mailing list dev-tech-js-engine-rhino

Re: Fwd: Host object vs wrapped

2009-12-30 Thread Daryl Stultz
On Tue, Dec 29, 2009 at 2:08 PM, Daryl Stultz da...@6degrees.com wrote: That's similar to what I want to do. My host object would be generic with no properties, just the inner POJO delegate. A call to get/put would cause the host object to use reflection to access the appropriate getter/setter

Re: Unwrap Factory?

2009-12-30 Thread Daryl Stultz
On Wed, Dec 30, 2009 at 1:34 PM, Daryl Stultz da...@6degrees.com wrote: domain.getChildren().add(new DomainEntity()); // fails because new object is really a WrapperEntity (ok, it doesn't actually crash but it does add a WrapperEntity to a List of DomainEntity. I'm currently experimenting

Re: Fwd: Host object vs wrapped

2009-12-30 Thread Daryl Stultz
believe I've found the solution to my problem. I'll follow up on the other thread. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech-js-engine-rhino

Re: Unwrap Factory?

2009-12-30 Thread Daryl Stultz
On Wed, Dec 30, 2009 at 1:34 PM, Daryl Stultz da...@6degrees.com wrote: Is there any way to automatically unwrap the object being added to the collection? Do I need to wrap all collections and implement add(), put(), etc. in order to unwrap it as it's being added? Between a WrapFactory

Caching wrapped objects in custom WrapFactory

2009-12-31 Thread Daryl Stultz
reference which scares me, I'm likely to produce a memory issue. I'm wondering if it would help performance or if the reflection lookup work is already being cached. IOW, is caching at the WrapFactory worth the performance improvement, if any? Thanks. -- Daryl Stultz

Re: Object equality

2010-01-04 Thread Daryl Stultz
know I won't be changing my code down the line in that regard. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech-js-engine-rhino mailing list dev

Re: Caching wrapped objects in custom WrapFactory

2010-01-04 Thread Daryl Stultz
burden to the GC to justify keeping them around. They're simply too light to cache. My concern was not memory use but the expense of method lookups via reflection. I imagine Rhino does a lot of caching of the lookups, then? -- Daryl Stultz _ 6 Degrees Software

Re: Caching wrapped objects in custom WrapFactory

2010-01-04 Thread Daryl Stultz
from never releasing that first scope from memory, which is a minor, fixed size memory usage increase), it might actually work in your scenario. Thanks, Attila, this is good information I'll file away until I get the time to address performance. -- Daryl Stultz

Re: Caching wrapped objects in custom WrapFactory

2010-01-04 Thread Daryl Stultz
On Mon, Jan 4, 2010 at 10:38 AM, Johan Compagner jcompag...@gmail.comwrote: the thing is that JavaMembers could cache Could it, should it, does it? Is this a feature/implementation request? -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http

Top level class alias

2010-01-19 Thread Daryl Stultz
the problem is, or how I can import classes into the top-level scope? Thanks. --Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech-js-engine-rhino mailing

Re: Top level class alias

2010-01-26 Thread Daryl Stultz
On Tue, Jan 19, 2010 at 4:05 PM, Daryl Stultz da...@6degrees.com wrote: Hello, I'm currently inserting text like this before compiling my script: Bar = Packages. + foo.Bar.class.getName() + ;\n + theScriptToRun as a way to alias the Bar class. I'd prefer not to do it this way

Re: Java 5.0 enum

2010-02-17 Thread Daryl Stultz
it in Rhino? Well, this is how I use them, which may not be what you want since it puts the values at the top level. Before running the script: ScriptableObject.*putProperty*(scope, CLUBS, Context.*javaToJS*(Cardsuit.* CLUBS*, scope)); -- Daryl Stultz _ 6 Degrees

Re: Java 5.0 enum

2010-02-18 Thread Daryl Stultz
? http://www.mozilla.org/rhino/tutorial.html About half way down. Not really documentation, but that's where I got it... -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com

Re: wrapfactory confusion

2010-03-17 Thread Daryl Stultz
* WrapFactory(); wrapFactory.setJavaPrimitiveWrap(*false*); context.setWrapFactory(wrapFactory); Sorry, I'm not sure if this will give you what you want or the opposite, it's been a while... -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www

Re: abstract keyword in JS and its implementation in Rhino1.7_R1

2010-04-16 Thread Daryl Stultz
. operator I don't have any real help for you, but I'm reminded that the same error is thrown (IIRC) on this: myobject.delete() I worked around it by renaming the function/method to remove(). Seems odd to me that it chokes on this, but I don't know the ECMA spec much at all. -- Daryl Stultz

Re: Cookies

2010-04-21 Thread Daryl Stultz
a look at HttpClient. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech-js-engine-rhino mailing list dev-tech-js-engine-rhino@lists.mozilla.org https

Re: Is possible to include js file into another js file?

2010-05-24 Thread Daryl Stultz
similar to Dan's however I'd like to replace it with require. There's been some work done here to support the require() function, I don't know much of the details, maybe someone else here can cover it. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http

Re: Import external Package/Class not working.

2010-05-27 Thread Daryl Stultz
On Wed, May 26, 2010 at 5:59 PM, sk doyouunderst...@gmail.com wrote: I keep getting: TypeError: [JavaPackage testpackage.Test] is not a function, it is object. Are you using a Class Shutter? I find I get this error for a class the shutter doesn't permit. -- Daryl Stultz

Context / Scope confusion

2010-11-22 Thread Daryl Stultz
sure what to do, so thoughts appreciated. Thanks. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com http://www.opentempo.com mailto:daryl.stu...@opentempo.com ___ dev-tech-js-engine

Re: Context / Scope confusion

2010-11-22 Thread Daryl Stultz
On Mon, Nov 22, 2010 at 4:00 PM, Daryl Stultz daryl.stu...@opentempo.comwrote: doesn't have any effect which makes sense since I created scope based on this. Perhaps my problem is really, how to expose global functions to the script. Can someone give me some examples of using

Re: Context / Scope confusion

2010-11-23 Thread Daryl Stultz
On Mon, Nov 22, 2010 at 5:20 PM, Ian Stevens i.stev...@syncapse.com wrote: On 2010-11-22, at 4:00 PM, Daryl Stultz wrote: So you can continue what you're doing (ie., init your Scriptable with functions to be accessed globally) but create scopes off your top-level scope (this) using