hi,
I had some difficulties making the ContentAggregator multithreaded. Now it
works, but there are still some open questions. One in dealing with
CocoonComponentManager, the other about the best design for the aggreagator.

(1) synchronization in CocoonComponentManager
---------------------------------------------
I always had null-pointer exceptions and index out of bound when processing
multiple parts for the aggregator in parallel in different threads.
It works when I declare the following methods in CocoonComponentManager as
synchronized:
  enterEnvironment,
  leaveEnvironment,
  startProcessing,
  endProcessing,
  addComponentForAutomaticRelease,
  removeFromAutomaticRelease,
  in EnvironmentDescription (same file) I also decleared
    addtoAutorelease and
    removeFromAutoRelease as synchronized

But I think this is only a workaround, so Im not realy sure what has to be
fixed to have a thread-safe implementation. I would apreciate any
information about how to go on.

(2) best practice for implementing aggregator
---------------------------------------------
What would be the best practice for the implementation of the multithreaded
ContentAggregator. I think there are to possibilities:

 a. Make it using IncludeCacheManager, that's the way the
CIncludeTransformer includes it's content, and it's the way my current
implementation works.

 b. Make it using SourceUtil.toSAX and MirrorRecorder. That would be a more
lightwight implementation than using all the CacheManagerSession stuff. But
it didn't work. With this way of implemeting it I had trouble with the
ComponentManager again.

So, does anybody know what exactly the IncludeCacheManagerSession does? I
could'n find something that seems to be so special, like creating a new
Environment/ComponentManager. Does anybody know anything about it?


How is the interest about having another implementation of ContentAggregator
within cocoon? And, is there anybody who could help me to get the
ComponentManager thread-safe?

Regards,
Christoph Gaffga
[EMAIL PROTECTED]

P.S. If anybody is interested in the code, I'll send it over if requested.

Reply via email to