felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pierre De Rop (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-5155) Adapter/Aspect extra service dependencies injected twice if using callback instance
Date Mon, 04 Jan 2016 11:27:39 GMT

    [ https://issues.apache.org/jira/browse/FELIX-5155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15081033#comment-15081033

Pierre De Rop commented on FELIX-5155:

Fix committed in revision 1722848: when an extra dependency is added to an aspect (or adapter),
then the service dependency callback instance (if set) is temporarily removed from the dependency,
and is cached in a datastructure, allowing to re-add it later, when instantiating concrete
aspect/adapter component instances.

See the following patched methods in the FilterComponent class:

public Component add(Dependency ... dependencies)
protected void copyDependencies(List<DependencyContext> dependencies, Component component)

> Adapter/Aspect extra service dependencies injected twice if using callback instance
> -----------------------------------------------------------------------------------
>                 Key: FELIX-5155
>                 URL: https://issues.apache.org/jira/browse/FELIX-5155
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-3.0.0
>            Reporter: Pierre De Rop
>            Assignee: Pierre De Rop
>             Fix For: 	org.apache.felix.dependencymanager-r7
> In the context of the new DM-lambda library, we found the following issue:
> When an aspect or an adapter is defined on an existing service, and if such aspect (or
adapter) declares some extra service dependencies, and if one of these extra dependencies
are using an external callback instance (in order to inject the extra dependency into the
adapter or aspect instance), then the callback instance is invoked twice:
> The first time, the callback instance is wrongly called by the internal aspect (or adapter)
AbstractDecorator component, and the second time it is correctly called in order to inject
the dependency into the callback instance.
> I have written a test case which reproduces this issue and will commit it soon.

This message was sent by Atlassian JIRA

View raw message