Hi,

if you use a factory, once resources from this factory are hit, an instance
for the current resource resolver is created exclusively for this resource
resolver. As resource resolvers are not thread safe, they shouldn't be used
from different threads (at least not concurrently) and therefore the same
applies for resource provider instances created by  a factory. These
instances are never pooled etc, once a resolver is closed, they are freed.
Whereas if you register a ResourceProvider directly, this is a singleton
which can be used concurrently.

In addition if you choose a RPFactory you can implement more functionality
as some of the extension interfaces of the RP interface are only used if
the instance is created via a factory.

Regards
Carsten


2013/10/3 dan mcweeney <mcwee...@adobe.com>

> I've been implementing the ResourceProviderFactory and wanted to find out
> if the providers that are returned from the factory are ever used by
> different threads or ever dropped into a pool and reused. Are there any
> differences between registering a Factory vs. just registering the provider
> that I need to be aware of?
>
> I did some testing and seems like they are never reused nor used by
> multiple threads but, I just wanted to confirm my anecdotal testing.
>
> -d
>



-- 
Carsten Ziegeler
cziege...@apache.org

Reply via email to