You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Xander Uiterlinden <xa...@gmail.com> on 2011/12/13 10:29:40 UTC

Fwd: Dependency manager feature suggestion: Allow passing resource attributes to resource adapters

Hi all,

I'm afraid I sent this message to the wrong list in the first attempt.
Please find my feature suggestion below and let me know what you think.

---------- Forwarded message ----------
From: Xander Uiterlinden <xa...@gmail.com>
Date: 2011/12/13
Subject: Dependency manager feature suggestion: Allow passing resource
attributes to resource adapters
To: dev-help@felix.apache.org


Hi all,

Currently we're using the dependency manager in our project. A feature we
extensively use is the resource adapter.
The resource adapter service gets access to a resource through the
abstraction of a URL. This is a nice abstraction
but raises challenges whenever an implementation requires more properties
of the resource, e.g. the last modification date
or the encoding.

At the moment we're working our way around it by creating implementing a
custom URLHandler.

It would be nicer if the resource adapter could be provided with a set of
optional properties. My suggestion would
be to extend the added(URL resource) method of the ResourceHandler with an
additional argument holding a
untyped set of properties. When provided these will be injected into the
resource adapter implementation.

Please let me know what you think.

Cheers,

Xander Uiterlinden

Re: Dependency manager feature suggestion: Allow passing resource attributes to resource adapters

Posted by Marcel Offermans <ma...@luminis.nl>.
Hello Xander,

On Dec 13, 2011, at 10:29 AM, Xander Uiterlinden wrote:

> Currently we're using the dependency manager in our project. A feature we
> extensively use is the resource adapter.
> The resource adapter service gets access to a resource through the
> abstraction of a URL. This is a nice abstraction
> but raises challenges whenever an implementation requires more properties
> of the resource, e.g. the last modification date
> or the encoding.
> 
> At the moment we're working our way around it by creating implementing a
> custom URLHandler.
> 
> It would be nicer if the resource adapter could be provided with a set of
> optional properties. My suggestion would
> be to extend the added(URL resource) method of the ResourceHandler with an
> additional argument holding a
> untyped set of properties. When provided these will be injected into the
> resource adapter implementation.

Interesting thought. I guess you could compare these properties to the ones you can specify when you register a service. Thinking along, you could also use these to provide a more precise filter condition for the ResourceHandlers you register.

I can see how this could speed things up.

Greetings, Marcel