I have an Apache Felix component who's definition looks like this:
...
@Component(immediate=true)
@Service
public class myClass implements myClassInterface {
...
@Activate
public void activate(final Map<String, Object> properties) {
//Do activation stuff
}
...
}
From reading the Apache Felix documentation on the @Component
and @Activate
annotations (http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-annotations.html#component) I understand that the immediate=true
attribute for the @Component
is "activated immediately". My problem is that my activate
method never seems to be invoked. I have my debugger on from the moment I build my project until the moment I request the service myClass
using OSGi, but the activate
method never seems to be invoked.
So, my question has a few layers:
1. Telling me that immediate=true
attribute causes the component to be "activated immediately" doesn't give me enough information. Does this mean that the component is activated immediately after the project is built, immediately after an instance of myClass
is created, or immediately after the service myClass
is requested by the OSGi bundle?
2. Is there anything that might cause my activate
method to not be invoked in spite of my usage of immediate=true
? If so, what can I do to correct the issue?
Thanks in advance for your help. Please let me know if I need to provide additional information.