avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: Divergence from Avalon (was Re: [RT] Is Poolable Harmful?)
Date Tue, 08 Jan 2002 16:38:15 GMT
Peter Royal wrote:

> On Tuesday 08 January 2002 11:12 am, Berin Loritsch wrote:
>>Therefore the point of the original thread was to merge SingleThreaded and
>>Poolable so that all SingleThreaded Components are pooled.
> I believe Cocoon made use of the SingleThreaded interface explicitly a few 
> months ago when there were problems with a Xerces instance not being able to 
> be reset properly after having experienced a SAXException.
> I do agree with the removal of Poolable and making the default for components 
> to be Poolable if not ThreadSafe, but I would suggest leaving SingleThreaded 
> so a component could be turned into a pure factory if need be. Granted it 
> would likely be the exception rather than the rule, but I think it would be 
> good to leave that functionality in there.
> -pete

I am familiar with the scenario.  The problem is really in the implementation.
The Parser Component was implemented in such a way as the Parser instance was
tied to the SAXReader instance.

In reality, the Parser component can be implemented as ThreadSafe.  The pool
of SAXReaders would be managed by returning the SAXReader once endDocument()
was called.

The problem in the end is not so much that the Component was forced to be
SingleThreaded by it's interface (like Generator, et al), but that it's
implementation was incorrect because of some faulty assumptions.

In hindsight, it was incorrect to make the Parser Component SingleThreaded.
The implementation of the Component should have been changed.


"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin

To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

View raw message