Thanks for your explanation, Berin!

I understand the difference, but - as I'm not a java expert - does
not know, what makes a component SingleThreaded. Which circumstances
must occur to declare a component so?

One of the components I wanted to make singlethreaded is the JaxpParser
in Cocoon2 (and that's actually the reason why I ask this question).
I don't see any specific code in that class.

Carsten

> Berin Loritsch wrote:
> 
> Carsten Ziegeler wrote:
> > 
> > Hi,
> > 
> > I just wanted to make a SingleThreaded component poolable. Is this
> > not allowed?
> 
> They are not allowed.  Currently SingleThreaded marks interfaces that
> cannot be reused, and must be used in one thread at a time.  Therefore,
> they are manufactured by the Factory method.
> 
> Poolable components (inherently only run in one thread at a time) can
> be reused, therefore when one thread is done with it, it is returned
> to the pool.
> 
> Notice the distinction.
> 
> > I get an exception from the excalibur component manager, which does
> > the following test:
> > >>>
> >         if (SingleThreaded.class.isAssignableFrom(componentClass))
> >         {
> >             numInterfaces++;
> >         }
> > 
> >         if (ThreadSafe.class.isAssignableFrom(componentClass))
> >         {
> >             numInterfaces++;
> >         }
> > 
> >         if (Poolable.class.isAssignableFrom(componentClass))
> >         {
> >             numInterfaces++;
> >         }
> > <<<
> > This means these interfaces can not combined. I agree that
> > SingleThreaded and ThreadSafe are not possible and
> > ThreadSafe and Poolable don't make sense, but
> > Poolable and SingleThreaded seems ok to me.
> > Or am I wrong?
> > 
> > Carsten
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to