I read on http://felix.apache.org/site/apache-felix-maven-scr-plugin.html Activate, Deactivate, and Modified
The Declarative Service version 1.1 allows to specify the name for the activate, deactivate and modified method (see the spec for more information). The Activate, Deactivate, and Modified annotation can be used to mark a method to be used for the specified purpose. However, as the DS specifies a method search algorithm, there are rare cases where the marked method is not used (if there is another method with the same name, but a different signature this might happen). MAybe specifying the name explicitely would help. Otherwise I suggest asking on the felix mailing list. Cheers, reto On Tue, Jul 27, 2010 at 10:25 AM, Henry Story <[email protected]> wrote: > > On 26 Jul 2010, at 18:43, Bertrand Delacretaz wrote: > > > Hi Henry, > > > > On Mon, Jul 26, 2010 at 5:39 PM, Henry Story <[email protected]> > wrote: > >> ...It looks like the activate method requires the ComponentContext > argument. > >> Without that the felxi OSGi component does not fetch it. Is that a > >> bug?... > > > > See [1], the activate method needs to have one argument, but 3 > > argument types variants are accepted. > > great. It looks like the one using java.util.Map would be best for the > keygen component, as it does not require that component to depend on > another > OSGi framework. (I am trying to write it so that it is very light weight, > and > useable by any java app that needs keygen) > > But 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... > > Thanks for the help, > > Henry > > > > >> I have seen a lot of documentation on the web that seems to suggest that > >> activate() should do... > > > > Looks like those suggestions are wrong. > > > >> > >> Is there a way one can set an arbitrary method to be the activate > method?.. > > > > I don't think so. > > > > -Bertrand > > > > [1] > http://www.osgi.org/javadoc/r4v42/org/osgi/service/component/ComponentContext.html > >
