Re: Context / Scope confusion

2010-11-23 Thread Daryl Stultz
On Mon, Nov 22, 2010 at 5:20 PM, Ian Stevens 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 Contex

Re: Context / Scope confusion

2010-11-22 Thread Daryl Stultz
On Mon, Nov 22, 2010 at 4:00 PM, Daryl Stultz wrote: > 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 > us

Re: Context / Scope confusion

2010-11-22 Thread Daryl Stultz
ps my problem is really, how to expose global functions to the script. Can someone give me some examples of using defineFunctionProperties()? I do plenty of this: ScriptableObject.putProperty(scope, "MyClass", new NativeJavaClass(scope, blah.MyClass.class)); which puts the static m

Context / Scope confusion

2010-11-22 Thread Daryl Stultz
ope"? I always use the same JavaScriptEvaluator instance for the entire thread, so I guess that could mean I'm using the same scope for the whole thread which is not my intention. It all seems pretty obvious now, but I'm not really sure what to do, so tho

Re: Can you set a classpath-like entry for Rhino?

2010-08-10 Thread Daryl Stultz
just text). > > There's been some discussion of supporting the "requires" function. That might get you in the right direction. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6d

Re: Import external Package/Class not working.

2010-05-27 Thread Daryl Stultz
On Wed, May 26, 2010 at 5:59 PM, sk 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 __

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

2010-05-24 Thread Daryl Stultz
h 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 __

Re: Cookies

2010-04-21 Thread Daryl Stultz
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://lis

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

2010-04-16 Thread Daryl Stultz
fter . 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

Re: wrapfactory confusion

2010-03-17 Thread Daryl Stultz
ry wrapFactory = *new* 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

Re: Java 5.0 enum

2010-02-18 Thread Daryl Stultz
from the terse > Javadoc? > > 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.

Re: Java 5.0 enum

2010-02-17 Thread Daryl Stultz
t; > how do I use 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

Re: Top level class "alias"

2010-01-26 Thread Daryl Stultz
On Tue, Jan 19, 2010 at 4:05 PM, Daryl Stultz 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

Top level class "alias"

2010-01-19 Thread Daryl Stultz
r" is not supported. My ClassShutter allows access to foo.Bar. Anyone know what 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:

Re: Caching wrapped objects in custom WrapFactory

2010-01-04 Thread Daryl Stultz
On Mon, Jan 4, 2010 at 1:01 PM, Attila Szegedi wrote: > On 2010.01.04., at 17:07, Daryl Stultz wrote: > You can, of course... Then in turn, ...of course, you could ... then might > Wow, this is a bit deeper than I thought. Thanks for the details. What's your opinion

Re: Caching wrapped objects in custom WrapFactory

2010-01-04 Thread Daryl Stultz
tandard". How would someone writing the JavaScript get tripped up by this? Thanks. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech

Re: Caching wrapped objects in custom WrapFactory

2010-01-04 Thread Daryl Stultz
On Mon, Jan 4, 2010 at 10:38 AM, Johan Compagner wrote: > 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://www.6degrees.

Re: Caching wrapped objects in custom WrapFactory

2010-01-04 Thread Daryl Stultz
another scope (the one >> ClassCache was first associated with) - I'm not sure if this can cause any >> problems (aside from never releasing that first scope from memory, which is >> a minor, fixed size memory usage increase), it might actually work in your >> scen

Re: Caching wrapped objects in custom WrapFactory

2010-01-04 Thread Daryl Stultz
is too insignificant 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 _

Re: Object equality

2010-01-04 Thread Daryl Stultz
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-

Caching wrapped objects in custom WrapFactory

2009-12-31 Thread Daryl Stultz
;weak 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? Thank

Alias class names

2009-12-31 Thread Daryl Stultz
roperty(scope, "Entity", yaddayadda); but I don't know what to put in for yaddayadda to reference the class. Anyone know? Thanks. --Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___

Object equality

2009-12-31 Thread Daryl Stultz
Hello, Neither == nor === invokes equals() on my Java objects. Should I expect either to return true? Obviously obj1.equals(obj2) works as expected. Sorry my JavaScript is not so good. Is there some method I need to implement to control how == works? Thanks. -- Daryl Stultz

Re: Unwrap Factory?

2009-12-30 Thread Daryl Stultz
On Wed, Dec 30, 2009 at 1:34 PM, Daryl Stultz 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 WrapFa

Re: Fwd: Host object vs wrapped

2009-12-30 Thread Daryl Stultz
, I 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-

Re: Unwrap Factory?

2009-12-30 Thread Daryl Stultz
On Wed, Dec 30, 2009 at 1:34 PM, Daryl Stultz 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 . I'm currently experimenting with WrapFactory

Unwrap Factory?

2009-12-30 Thread Daryl Stultz
n? Do I need to wrap all collections and implement add(), put(), etc. in order to unwrap it as it's being added? Has anyone run into this? -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailt

Re: Fwd: Host object vs wrapped

2009-12-30 Thread Daryl Stultz
between the Java constructor and the JS constructor. I'm currently exploring a path using a WrapFactory. If it doesn't pan out I'll give your suggestion a try. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com ma

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:

2009-12-30 Thread Daryl Stultz
, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call. Anyone know what I'm supposed to do? object1 and object2 are Foo classes, of course, wrapped to be Scriptable. Thanks. -- Daryl Stultz _ 6 Degrees Software and Consu

Re: Fwd: Host object vs wrapped

2009-12-30 Thread Daryl Stultz
On Tue, Dec 29, 2009 at 2:08 PM, Daryl Stultz 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/s

Re: Fwd: Host object vs wrapped

2009-12-29 Thread Daryl Stultz
I'm not sure how this could be done 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

Re: Host object vs wrapped

2009-12-29 Thread Daryl Stultz
On Tue, Dec 29, 2009 at 1:46 PM, Mark Storer wrote: > On Tue, Dec 29, 2009 at 5:29 AM, Daryl Stultz wrote: > > I do appreciate the annotations approach to writing host objects but it's > > actually off topic from my original post. > > I disa

Re: Host object vs wrapped

2009-12-29 Thread Daryl Stultz
comes from the same object and I want it to come from the delegate. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech-js-engine-rhino mailing list d

Re: Host object vs wrapped

2009-12-28 Thread Daryl Stultz
p the domain classes in a "JS API" class. The wrapper would implement Scriptable and use annotations to determine if the domain method being accessed (via scriptable.get("myMethod", start), for example) should be allowed. While annotations would be

Host object vs wrapped

2009-12-25 Thread Daryl Stultz
king for some feature of Rhino or JavaScript that might let me more easily define what methods of the domain class are accessible. I'm wondering if a host object has such features. Any input on how others are handling this type of thing would be appreciated. Thanks. -- Daryl Stultz ___

Re: Fw: Error handling - Help required !!

2009-12-18 Thread Daryl Stultz
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.

Re: Fw: Error handling - Help required !!

2009-12-16 Thread Daryl Stultz
? can we get 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

Re: Calling Java CLI programs through Rhino

2009-10-28 Thread Daryl Stultz
rameters to the function and have it modify the parameters, return new data, etc. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degrees.com ___ dev-tech-js-engine-r

Re: Installation for use on command line

2009-09-08 Thread Daryl Stultz
a Java application you want 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. htt

Re: API design

2009-05-19 Thread Daryl Stultz
On Mon, May 18, 2009 at 11:12 AM, Daryl Stultz 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 (a

API design

2009-05-18 Thread Daryl Stultz
asses clearly illustrate the classes and functions exposed to the JavaScript. 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 AP