Torsten Curdt wrote:
>
> Hi, that's exactly what I was wondering, too
>
> > > 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.
>
> But why?! I have a component that is not ThreadSafe (and therefor I would
> like to declare it SingleThreaded. But it since it is just a helper component
> and there is no need to create new instances all the time I'd like to
> make it Rececylable (extends Poolable)
>
> What is wrong with this approach?
If it can be reused, then make it Recyclable--that implcitly makes the component
Poolable. There is not problem with that approach. However, if for reasons
beyond _your_ control the component cannot be reused you must use the SingleThreaded
interface.
> > Poolable components (inherently only run in one thread at a time) can
>
> So Poolable should extend SingleThreaded ?!
Theorhetically, this may be true. Poolable is a special case of a component
that must be single threaded. However, the SingleThreaded concept is familiar
to Servlet writers who use the variation of the Servlet that forces a new copy
to be created for each request--or serialize all accesses to it so only one
thread accesses it at a time. Clearly not optimal--though sometimes necessary.
>
> > be reused, therefore when one thread is done with it, it is returned
> > to the pool.
> --
> Torsten
>
> ---------------------------------------------------------------------
> 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]