Stefano Mazzocchi wrote:
Berin Loritsch wrote:

Fortress (The ECM replacement) has a feature that allows you to
automatically gather all your roles and components that implement
those roles at runtime.  There is no need to maintain a separate
file, or to include a "user-roles" document.


Hmmm, how do you do that? I mean, the classloader doesn't have a way to for you to gather all the classes it contains in its address space.

Please don't tell me you are looking into the jars directly!

:) Nope.


Pretty standard placement of meta-info files.

At the root of the jar that is run with Fortress's ANT tools is a
"services.list" file.  This tells fortress which service entries
are available in the JAR.

It then uses that information to load in all the JAR Services
compliant entries.  For instance, the file might have:

org.apache.cocoon.generate.Generator
org.apache.cocoon.transform.Transformer

And in the JAR file there would be another list for the implementations
of each service:

META-INF/services/org.apache.cocoon.generate.Generator
         (lists all implementations in the jar)
META-INF/services/org.apache.cocoon.transform.Transformer
         (lists all implementations in the jar)

The classes aren't loaded until they are actually needed.

This should not only make things easier for the migration to any
container the Avalon team could possibly think of in the future,
it also provides a much easier way to integrate user components
in Cocoon based applications.


I like it.

+1

I would suggest to do the transition from ECM to Fortress for Cocoon 2.2, anybody against this?

I am for it. It might help with the Block initiative.





Reply via email to