You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Tuomas Kiviaho (JIRA)" <ji...@apache.org> on 2013/02/22 09:52:12 UTC

[jira] [Created] (FELIX-3912) Support for static field injections and callback invocations

Tuomas Kiviaho created FELIX-3912:
-------------------------------------

             Summary: Support for static field injections and callback invocations
                 Key: FELIX-3912
                 URL: https://issues.apache.org/jira/browse/FELIX-3912
             Project: Felix
          Issue Type: Improvement
          Components: Dependency Manager
            Reporter: Tuomas Kiviaho


I've got a case (JUnit tests) where static field injections and callback invocation would be more than welcome. I'm succesfully using DependencyManager in the same manner as Sonatype Sisu for my integration tests, but test execution times become quite high when using @TestRule instead of @ClassRule.

The codebase seems to be crafted statics in mind since there are only handful of locations which prevent this. The biggest blocker is Component.setImplementation that would need an information preventing instantiation. The same information would be used to determine at callbacks and field injections whether to perform these or not.

I guess that the most pain would come from annotation api where possibility of method overloading should be taken into account, but that could get static support later on. 

I could provide a patch if this idea gets wind under it. Personally I dislike the idea of using statics anywhere else that within unit/integration tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira