I've thought about the uses of executing scripts via EJBs off and on in the past several months and wanted to toss the idea out to the developers for feedback.

The basic idea is similar to using Jelly as a service in an Avalon container, but instead it would be implemented as a stateless session bean, or even as a message driven bean; essentialy a server side scripting service. The scenario would be that an application could use a SSB to execute scripts which are primarily business logic oriented and they would execute inside of a transaction (or not), or if using a MDB, an app or service could send a message (perhaps a MapMessage would be appropriate, for putting values into a JellyContext) to a queue/topic which the MDB would pick up and execute the script, maybe even sending another message via the jelly:jms tags.

My first thought was geared similiar to what I am working with on the Avalon based JellyService, where you can have 'named' scripts as well as execute via URL, however there are a couple of gotcha's that come to mind:

First, you couldn't supply an OutputStream, since streams aren't serializable, so that option is out.

Second, how to configure the named scripts. The 'easy' solution would be to supply them in the deployment descriptor for the SSB. A slightly more complicated solution would be to have the config in an XML file somewhere and the SSB reads that in. The SSB could then be setup to 'reload' the config and/or scripts on each invocation or not, which would be useful when developing. The developer could change the script file, rerun the app/test without having to bump the server.

Maybe it would lead to a set of taglibs that were geared towards looking up and executing other EJBs...

Anyway, that is food for thought...

- Robert McIntosh


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to