May 12, 2003

Cocoon flow in Java

Ovidiu tells us about Cocoon flow controller implemented in Java. Wow, this is something I've been dreaming of for a long time, and had some deep thoughts about just yesterday while digging the soil in my garden (yes, physical work frees the brain, and this is often at that time that I have very deep technical thoughts...)

Although JavaScript allows rapid prototyping, I miss many of Java's features when writing flow scripts, such as strong typing and all the Eclipse features (code completion, javadoc tooltips, etc).

Yesterday's thoughts ended with the following action items to have flow written in Java :
  • Hardest point : we first must have continuations in Java. Taking Brakes as a starting point, this shouldn't be that much work. I also thought about tail-call optimization (tail recursion is easy), which can partially be implemented (we can trash all local variables, but I think we need to keep the full method call chain).
  • Automatic compiling classloader. Next to continuations, the niciest feature of flow script is the fast trial and error cycle : save your file, reload and see your changes. The same can be possible with a smart classloader that takes a source files directory instead of a class files directory. If the source file changes, it is recompiled a soon as someone calls ClassLoader.loadClass() on the corresponding class. We can also use some delegating proxies for the case where classes are loaded only once (e.g. Avalon container factories). Once you're satified with your class, you can deactivate the auto-compiling class loader and deploy a class file as usual.
  • On-the-fly continuation enabler. This is another classloader which passes bytecode through the continuation transforming engine (first point above). Since not all classes require to be continuation-enabled, only classes implementing a particular marker interface will be transformed.
With the above features, Cocoon flow would rock the planet even more than it is today. I'll do all this in my copious free time. Are there some friendly volunteers with enough bytecode hacking knowledge that would like to help me ?

With the flow implemented in Java, does the "Interpreter" interface name still make sense as it does with Scheme or JavaScript ? It seems to me "Controller" or "ContinuationEnabledLanguage" would be more appropriate.

Posted by Sylvain Wallez at May 12, 2003 01:33 PM
Comments

Not that I have done any java bytecode stuff yet and my timetable lacks the same free spots as yours...
But count me in as "friendly volunteer" :)

Posted by: Torsten Curdt on May 13, 2003 09:47 AM

Hi Sylvain,

I am not yet familiar with with Brakes, but I would doubt that features as important as preseving stack trace can be easily implemented using Breaks' approach.

alex krut

Posted by: Alex Krut on May 14, 2003 06:43 AM

I am a fresh cocoon user. I would like to keep accross many pipelines the value of some parameters initialized thanks to a CFORMS.

How I cloud make this without storing information in a specific session context ?

Also, How I do when I try to modify their values

Best regrad, thanks for your help in advance
Douad Douentza

Posted by: Douentza on March 30, 2005 02:42 PM