Hi,

I am complteley new to Sling and tasked with creating a ResourceProvider 
implementation. I have been digging thorugh the docs for a while but, honestly, 
would appreciate some help :-)

My ResourceProvider needs to contact an upstream HTTP server(s), so it needs to 
use an HTTP client, preferably the Apache HTTP Client. Performance and 
concurrency requirements are very high - I am not building a pet project. This 
raises a number of questions for me:

- Where do I best put the HTTP client instance and where do I configure it? It 
is likely a caching client and I plan to make it multi-threaded, too (use a 
connection pooling configuration for the Apache client)
  I am looking for the right spot of the Sling runtime here, to wire the client 
to.

- Or is there maybe a client instance in the Sling runtime that I can just 
obtain and use from within my ResourceResolver?

- Do I have to write a Factory for my Resolver? And how does a Sling 
application specify it wants to work with resource from my provider? IOW, How 
does the bootstrapping work?

- Do I also have to write a ResourceResolver and bootstrap that, too? Or does 
the runtime provide its own to my ResourcePorvider?

- Will instances of my ResourceProvider be used concurrently, or is a new 
instance created for every request to sling?

- How do I obtain a reference to my (global) HTTP client inside my 
ResourceProvider?

Excuse the big bunch of newbie questions, but I feel I need hands-on 
information directly as opposed digging around - especially the concurrency and 
bootstrapping aspects I'd really like to not mess up :-)

Jan

Reply via email to