incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <bdelacre...@apache.org>
Subject Re: activate(ComponentContext context) or activate() ?
Date Tue, 27 Jul 2010 09:48:53 GMT
Hi,

On Tue, Jul 27, 2010 at 10:25 AM, Henry Story <henry.story@gmail.com> wrote:
>
> On 26 Jul 2010, at 18:43, Bertrand Delacretaz wrote:
>>... See [1], the activate method needs to have one argument, but 3
>> argument types variants are accepted.
>
> ...I just tried using the method with signature
>
>    protected void activate(Map properties)
>
> in the KeygenService implementation at http://github.com/bblfish/keygenapp
> but Clerezza no longer calls it. It does get called when I have the ComponentContext
argument...

This should work according to the OSGi compendium spec 4.2, 112.5.8,
"Activate Method".

I'm not too familiar with the Felix code that handles this but it
looks like it's [2] which is getting the activate method, and that
should support a single Map parameter in activate(), but only if the
component is using the Declarative Services spec version 1.1.

According to [3] the maven-scr-plugin detects if your component is
using features from the spec version 1.1, maybe you need to force that
using the specVersion plugin config.

A buggy version of the Felix SCR bundle might also cause the problem,
according to http://felix.apache.org/site/downloads.cgi the current
version is 1.4.0.

HTH, and I'm interested in finding out why that doesn't work!
-Bertrand

[2] http://svn.apache.org/repos/asf/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/helper/ActivateMethod.java

[3] http://felix.apache.org/site/apache-felix-maven-scr-plugin.html

Mime
View raw message