You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Pierre De Rop (JIRA)" <ji...@apache.org> on 2009/06/26 07:27:07 UTC

[jira] Created: (FELIX-1278) DM/ AutoConfig is active event if setCallbacks method has been invoked

DM/ AutoConfig is active event if setCallbacks method has been invoked
----------------------------------------------------------------------

                 Key: FELIX-1278
                 URL: https://issues.apache.org/jira/browse/FELIX-1278
             Project: Felix
          Issue Type: Bug
          Components: Dependency Manager
    Affects Versions: dependencymanager-2.0.1
         Environment: linux fc10/ jdk1.5/1.6
            Reporter: Pierre De Rop
            Priority: Minor


Marcel, in this issue, I come back to you about an old thread that I posted last november 2008 here -> http://www.mail-archive.com/users@felix.apache.org/msg02582.html

In this thread, I mentioned a potential problem concerning AutoConfiguration: Indeed, AutoConfig is active by default, even if ServiceDependency.setCallbacks() method has been invoked. So, all Pojo's attributes (wich types are the same as the injected dependency) are overriden by reflexion (auto config mode).
Currently, each time I call setCallbacks(), I must take care of calling setAutoConfig(false) ... 
We think that AutoConfig mode should be disabled when setCallbacks methods is invoked.

/pierre

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (FELIX-1278) DM/ AutoConfig is active event if setCallbacks method has been invoked

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Offermans reassigned FELIX-1278:
---------------------------------------

    Assignee: Marcel Offermans

> DM/ AutoConfig is active event if setCallbacks method has been invoked
> ----------------------------------------------------------------------
>
>                 Key: FELIX-1278
>                 URL: https://issues.apache.org/jira/browse/FELIX-1278
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-2.0.1
>         Environment: linux fc10/ jdk1.5/1.6
>            Reporter: Pierre De Rop
>            Assignee: Marcel Offermans
>            Priority: Minor
>
> Marcel, in this issue, I come back to you about an old thread that I posted last november 2008 here -> http://www.mail-archive.com/users@felix.apache.org/msg02582.html
> In this thread, I mentioned a potential problem concerning AutoConfiguration: Indeed, AutoConfig is active by default, even if ServiceDependency.setCallbacks() method has been invoked. So, all Pojo's attributes (wich types are the same as the injected dependency) are overriden by reflexion (auto config mode).
> Currently, each time I call setCallbacks(), I must take care of calling setAutoConfig(false) ... 
> We think that AutoConfig mode should be disabled when setCallbacks methods is invoked.
> /pierre

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-1278) DM/ AutoConfig is active event if setCallbacks method has been invoked

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Offermans resolved FELIX-1278.
-------------------------------------

    Resolution: Fixed

Patch applied.

> DM/ AutoConfig is active event if setCallbacks method has been invoked
> ----------------------------------------------------------------------
>
>                 Key: FELIX-1278
>                 URL: https://issues.apache.org/jira/browse/FELIX-1278
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-2.0.1
>         Environment: linux fc10/ jdk1.5/1.6
>            Reporter: Pierre De Rop
>            Assignee: Marcel Offermans
>            Priority: Minor
>         Attachments: ServiceDependency.java
>
>
> Marcel, in this issue, I come back to you about an old thread that I posted last november 2008 here -> http://www.mail-archive.com/users@felix.apache.org/msg02582.html
> In this thread, I mentioned a potential problem concerning AutoConfiguration: Indeed, AutoConfig is active by default, even if ServiceDependency.setCallbacks() method has been invoked. So, all Pojo's attributes (wich types are the same as the injected dependency) are overriden by reflexion (auto config mode).
> Currently, each time I call setCallbacks(), I must take care of calling setAutoConfig(false) ... 
> We think that AutoConfig mode should be disabled when setCallbacks methods is invoked.
> /pierre

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1278) DM/ AutoConfig is active event if setCallbacks method has been invoked

Posted by "Pierre De Rop (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pierre De Rop updated FELIX-1278:
---------------------------------

    Attachment: ServiceDependency.java

> DM/ AutoConfig is active event if setCallbacks method has been invoked
> ----------------------------------------------------------------------
>
>                 Key: FELIX-1278
>                 URL: https://issues.apache.org/jira/browse/FELIX-1278
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-2.0.1
>         Environment: linux fc10/ jdk1.5/1.6
>            Reporter: Pierre De Rop
>            Assignee: Marcel Offermans
>            Priority: Minor
>         Attachments: ServiceDependency.java
>
>
> Marcel, in this issue, I come back to you about an old thread that I posted last november 2008 here -> http://www.mail-archive.com/users@felix.apache.org/msg02582.html
> In this thread, I mentioned a potential problem concerning AutoConfiguration: Indeed, AutoConfig is active by default, even if ServiceDependency.setCallbacks() method has been invoked. So, all Pojo's attributes (wich types are the same as the injected dependency) are overriden by reflexion (auto config mode).
> Currently, each time I call setCallbacks(), I must take care of calling setAutoConfig(false) ... 
> We think that AutoConfig mode should be disabled when setCallbacks methods is invoked.
> /pierre

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (FELIX-1278) DM/ AutoConfig is active event if setCallbacks method has been invoked

Posted by "Pierre De Rop (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pierre De Rop reopened FELIX-1278:
----------------------------------


Marcel,
I reopen this issue because, with the previous patch, the following code was not working:

    dm.add(createService()
	   .setImplementation(MyPojo.class)
	   .add(createServiceDependency()
		.setRequired(false)
		.setService(MyDependency.class)
                .setAutoConfig(true)
		.setCallbacks("added", "removed")));

(the setCallbacks turns off autoconfig and the setAutoConfig(true) is disabled).
The attached patch just check if the setAutoConfig method has been called or not. If yes, then the setCallbacks method does not turn off autoconfig.

(I have also added some documentation in the setCallbacks method).
  
 


> DM/ AutoConfig is active event if setCallbacks method has been invoked
> ----------------------------------------------------------------------
>
>                 Key: FELIX-1278
>                 URL: https://issues.apache.org/jira/browse/FELIX-1278
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-2.0.1
>         Environment: linux fc10/ jdk1.5/1.6
>            Reporter: Pierre De Rop
>            Assignee: Marcel Offermans
>            Priority: Minor
>
> Marcel, in this issue, I come back to you about an old thread that I posted last november 2008 here -> http://www.mail-archive.com/users@felix.apache.org/msg02582.html
> In this thread, I mentioned a potential problem concerning AutoConfiguration: Indeed, AutoConfig is active by default, even if ServiceDependency.setCallbacks() method has been invoked. So, all Pojo's attributes (wich types are the same as the injected dependency) are overriden by reflexion (auto config mode).
> Currently, each time I call setCallbacks(), I must take care of calling setAutoConfig(false) ... 
> We think that AutoConfig mode should be disabled when setCallbacks methods is invoked.
> /pierre

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-1278) DM/ AutoConfig is active event if setCallbacks method has been invoked

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Offermans resolved FELIX-1278.
-------------------------------------

    Resolution: Fixed

Implemented the change. Please review and test it!

> DM/ AutoConfig is active event if setCallbacks method has been invoked
> ----------------------------------------------------------------------
>
>                 Key: FELIX-1278
>                 URL: https://issues.apache.org/jira/browse/FELIX-1278
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-2.0.1
>         Environment: linux fc10/ jdk1.5/1.6
>            Reporter: Pierre De Rop
>            Assignee: Marcel Offermans
>            Priority: Minor
>
> Marcel, in this issue, I come back to you about an old thread that I posted last november 2008 here -> http://www.mail-archive.com/users@felix.apache.org/msg02582.html
> In this thread, I mentioned a potential problem concerning AutoConfiguration: Indeed, AutoConfig is active by default, even if ServiceDependency.setCallbacks() method has been invoked. So, all Pojo's attributes (wich types are the same as the injected dependency) are overriden by reflexion (auto config mode).
> Currently, each time I call setCallbacks(), I must take care of calling setAutoConfig(false) ... 
> We think that AutoConfig mode should be disabled when setCallbacks methods is invoked.
> /pierre

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1278) DM/ AutoConfig is active event if setCallbacks method has been invoked

Posted by "Arjun Panday (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741775#action_12741775 ] 

Arjun Panday commented on FELIX-1278:
-------------------------------------

I just tried it and it works. Thanks again.

> DM/ AutoConfig is active event if setCallbacks method has been invoked
> ----------------------------------------------------------------------
>
>                 Key: FELIX-1278
>                 URL: https://issues.apache.org/jira/browse/FELIX-1278
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-2.0.1
>         Environment: linux fc10/ jdk1.5/1.6
>            Reporter: Pierre De Rop
>            Assignee: Marcel Offermans
>            Priority: Minor
>
> Marcel, in this issue, I come back to you about an old thread that I posted last november 2008 here -> http://www.mail-archive.com/users@felix.apache.org/msg02582.html
> In this thread, I mentioned a potential problem concerning AutoConfiguration: Indeed, AutoConfig is active by default, even if ServiceDependency.setCallbacks() method has been invoked. So, all Pojo's attributes (wich types are the same as the injected dependency) are overriden by reflexion (auto config mode).
> Currently, each time I call setCallbacks(), I must take care of calling setAutoConfig(false) ... 
> We think that AutoConfig mode should be disabled when setCallbacks methods is invoked.
> /pierre

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1278) DM/ AutoConfig is active event if setCallbacks method has been invoked

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735246#action_12735246 ] 

Marcel Offermans commented on FELIX-1278:
-----------------------------------------

Let me start by saying, I think you're right. Turning off AutoConfig when a user defines callbacks would have helped (it saves him from having to do this himself).

The change I could make is that if setCallbacks() is invoked with at least one non-null argument, AutoConfig becomes false (and it becomes true again if you pass all null arguments, because that probably signals you no longer want callbacks to be invoked).

The biggest worry I have is breaking existing code that relies on the current behavior. I'm not quite sure how big the problem is there, because I guess most people using callbacks will now have these two lines of code anyway, and a change would only render the call to setAutoConfig() obsolete (but harmless).

Summarizing it, I am leaning heavily towards changing this, which means changing the semantics of the API, so it would require us to go to version 3.0.0. If anyone else wants to comment on this, now is the time! :)

> DM/ AutoConfig is active event if setCallbacks method has been invoked
> ----------------------------------------------------------------------
>
>                 Key: FELIX-1278
>                 URL: https://issues.apache.org/jira/browse/FELIX-1278
>             Project: Felix
>          Issue Type: Bug
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-2.0.1
>         Environment: linux fc10/ jdk1.5/1.6
>            Reporter: Pierre De Rop
>            Assignee: Marcel Offermans
>            Priority: Minor
>
> Marcel, in this issue, I come back to you about an old thread that I posted last november 2008 here -> http://www.mail-archive.com/users@felix.apache.org/msg02582.html
> In this thread, I mentioned a potential problem concerning AutoConfiguration: Indeed, AutoConfig is active by default, even if ServiceDependency.setCallbacks() method has been invoked. So, all Pojo's attributes (wich types are the same as the injected dependency) are overriden by reflexion (auto config mode).
> Currently, each time I call setCallbacks(), I must take care of calling setAutoConfig(false) ... 
> We think that AutoConfig mode should be disabled when setCallbacks methods is invoked.
> /pierre

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.