[
https://issues.apache.org/jira/browse/FELIX-4964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632459#comment-14632459
]
David Jencks commented on FELIX-4964:
-------------------------------------
You'll be able to see my idea soon.... it seems to be working.
Trackers are much much more complicated than service listeners, and the initial
query part is not part of this problem.
We have to do this per bundle, since we have no practical way of replicating
the service hooks that determine which events are visible to which bundles.
Sending an event to the outside world involves a security check, so I'd prefer
to reduce the number of events shown to a bundle if practical.
So my solution is for the BundleComponentActivator to register a
ServiceListener for each service class for which there is at least one
dependency manager, and to distribute the events received to the dependency
managers for that bundle after filtering and creating appropriate endmatch
events from modified events. Since the service tracker already doesn't
propagate events to unknown service refs, we don't need to worry about only
generating endmatch events for refs that previously actually matched, so this
path is slightly simpler than the one in the service registry.
> [DS] Reactivate component at most once per service event
> --------------------------------------------------------
>
> Key: FELIX-4964
> URL: https://issues.apache.org/jira/browse/FELIX-4964
> Project: Felix
> Issue Type: Bug
> Components: Declarative Services (SCR)
> Affects Versions: scr-2.0.0
> Reporter: David Jencks
> Assignee: David Jencks
> Fix For: scr-2.0.0
>
>
> When a component has several references to the same service (most likely
> scenario is field references for object, properties, service ref all for the
> same service) and a service event results in the component being deactivated
> and activated (such as a static reference being replaced by another) then we
> should only reactivate the component instance once.
> The solution I have in mind involves distributing events to the service
> trackers for the components in a bundle through the BundleComponentActivator
> and tracking the components that need to be activated with the event. Once
> all the relevant service trackers have been notified, we can try to activate
> all the components relevant to that service event.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)