RE: [tcljava-user] JACL Script inside EJB
Brought to you by:
mdejong
From: Sai G. M N <Sai...@pl...> - 2000-11-08 11:43:19
|
Wow, This was a quick and a good explanation. Have been poring over this for a week. Would be very much interested in helping to make the getting started tutorial for Jacl. Sure. Right now, is there any documentation on getting started? I have bee able to see only "New Features", "F.A.Q" and "Man Pages" apart from "Download" at this URL: http://dev.ajubasolutions.com/software/java/ Would be glad to read if there is any "Getting Started" information available already! Thanks anyway. Will try what ever you have said below and hope it helps! Sai > -----Original Message----- > From: Mo DeJong [SMTP:md...@cy...] > Sent: Wednesday, November 08, 2000 4:18 PM > To: tcl...@li... > Subject: Re: [tcljava-user] JACL Script inside EJB > > On Wed, 8 Nov 2000, Sai Geetha M N wrote: > > > Hi > > > > I am trying to run a JACL script inside an EJB (Enterprise JavaBean). I > pass > > the name of the script as an input paramater. Then the EJB reads that > file > > and runs it using the Interp.evalFile Command. So Far, so good > > However, I want to be able to pass a Java Object (or may be a TclObject) > to > > that script and the script should work on that object. Basically, the > object > > would contain name-value pairs, which are the arguments for the script > to > > work on. > > It sounds like you want to take some Java info and wrap it up > in a TclList. You would then set a variable in Tcl to this > TclList. > > > 1. Is this kind of a scenario implementable in JACL? > > Sure. > > > 2. If so, will any JACL script be able to understand Java Collection > Objects > > or should I convert them into TclObjects? Is this possible and how? > > You would want to take the data out of a Java vector and put it > into a TclList. You Java code would just allocate a TclList object > and then loop over the Java elements adding them to the TclList. > > Something like (this is just off the top of my head): > > TclObject to = TclList.newInstance() > Vector v = ... > > while (! done) { > TclObject str = TclList.newInstance((String) v.elementAt(i) ); > TclList.append(interp, list, str); > } > > > 3. Once I convert it to a TclObject, how do I make the JACL script > access > > this object? CAn I pass it as a parameter to the script? > > Set a variable in the interp. See the interp.setVar() command docs. > These docs live in tcljava/docs/TclJavaLib. > > It seems clear that we need better "getting started" documentation. > Would you be willing to take notes as you learn this stuff and > help with a short tutorial later? > > Mo DeJong > Red Hat Inc > _______________________________________________ > tcljava-user mailing list > tcl...@li... > http://lists.sourceforge.net/mailman/listinfo/tcljava-user |