The document discusses Rapid Application Development (RAD) features in Cocoon including auto-compiling and reloading of classes, JavaFlow, and components. It describes the Jakarta Commons Incubator Java Compiler Interface (JCI) and JavaFlow projects which enable compiling and reloading classes as well as Java continuations through bytecode instrumentation. Potential future plans are mentioned such as removing limitations, improving optimization, and releasing within a few months.
Rapid Application Development with Cocoon's Compiling Classloader and Javaflow
1. Torsten Curdt
<vafer/>.org tcurdt@apache.org
Rapid Application
Development
with Cocoon
javaflow and the
compiling classloader
Cocoon GetTogether 2005,
Amsterdam
2. about me : 2
:
• with Cocoon since 1.x
• member of the Cocoon PMC
• member of the Jakarta PMC
• ASF member
3. quote : 3
:
“Rapid Application Development is
exactly the opposite of what Cocoon
provided a fears ago - but gladly
enough times have changed”
Torsten Curdt
4. agenda : 4
:
• general environment hints
• Cocoon features for RAD
• web application and IDE config
• live demonstration
• behind the scenes
• overview of jci and javaflow
5. hints : 5
:
• stripped down version of Cocoon
• build the source jars
• relocate the webapp with the
COCOON_WEBAPP_HOME
environment variable
• use “cocoon servlet-debug”
6. features : 6
:
• compiling + reloading of classes
• compiling + reloading of javaflow
• compiling + reloading of components
• reloading of jars
16. gotchas : 16
:
• objects in sessions
• parent component manager
component interactions
• old continuations
17. commons : 17
:
• commons jci does the
• monitoring
• compilation
• commons javaflow provides
• java continuations
• cocoon javaflow block
• evolved out of cocoon 2.1
• now being used in cocoon trunk
18. cocoon block : 18
:
• flow interpreter
• flow object model
• base classes
• integration with CForms
19. example : 19
:
public class MyFlow extends
AbstractContinuable {
public void run() {
...
sendPageAndWait(
”page”, data);
...
}
20. jci : 20
:
• compiler abstraction
• supports eclipse, janino, groovy
• filesystem monitoring
• events for create, change and delete
• compiling/reloading class loader
http://jakarta.apache.org/commons/sandbox/jci
21. jci API : 21
:
CompilationResult result =
compiler.compiler(
classNames,
new FileResourceReader(dir),
new MemoryResourceStore());
if (result.getErrors()
.length > 0) { ...
22. jci API : 22
:
FilesystemAlterationMonitor
fam = new F..A..M();
fam.start();
fam.addListener(
new CompilingListener(
dir));
23. future : 23
:
• almost ready for a release
(94% testcase coverage!!)
• better dependencies support
• adding more compilers
• javac, pizza, jikes, gcj
• maven might switch to jci
24. javaflow : 24
:
• java continuations through
bytecode instrumentation
• works hand in hand with jci
• ant-task for jar/class rewriting
• supports serialization(!!)
http://jakarta.apache.org/commons/sandbox/javaflow
25. javaflow API : 25
:
Continuation continuation =
Continuation.startWith(
new Calculator());
...
Continuation.continueWith(
continuation);
28. scalability : 28
:
• the deeper your flow, the more
memory used per continuation
• increases linearly
• avoid recursion
• the more method calls, the more
overhead
• can be heavily optimized
29. limitations : 29
:
• suspend in synchronized blocks
• suspend in a catch/finally
30. future plans : 30
:
• remove current limitations
• call graph analysis for optimization
• switching from BCEL to ASM(?)
• support for external suspends(?)
• talking with the guys from RIFE
• release within the next few months
31. summary : 31
:
• auto-compiling and reloading of
• classes
• javaflow
• components
• full IDE support
• debugging
• refactoring
• (potential) serialization support
• persisting continuations across restarts
• session and flow replication