Bug 381353 - Request: ContextInjectionFactory.invokeAll(Object object, Class<? extends Annotation> qualifier, IEclipseContext context)
Summary: Request: ContextInjectionFactory.invokeAll(Object object, Class<? extends Ann...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 4.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-01 07:53 EDT by Christoph Keimel CLA
Modified: 2013-07-17 01:33 EDT (History)
3 users (show)

See Also:


Attachments
proposed implementation (4.53 KB, patch)
2012-06-01 07:54 EDT, Christoph Keimel CLA
no flags Details | Diff
usage in E4 life cycle manager (1.36 KB, patch)
2012-06-01 07:54 EDT, Christoph Keimel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Keimel CLA 2012-06-01 07:53:35 EDT
Build Identifier: I20120315-1300

Assuming we have a class Bar extending super class Foo: Wouldn’t it be nice for the ContextInjectionFactory to be able to handle situations where:
a)	Bar and Foo both contain a method annotated with the qualifier annotation
b)	Bar or Foo have multiple methods annotated with the qualifier annotation
c)	Bar and Foo have multiple methods annotated with the qualifier annotation

Currently, only the “first” method will be called. This makes sense, if one is interested in the return value of the called method. But in a lot of cases the called methods will be void (i.e. life cycle invocations). I think it would be nice to have something like:

public void invokeAll(Object object, Class<? extends Annotation> qualifier, IEclipseContext context)

in ContextInjectionFactory (possibly with a return of Object[]).

I am interested because I am currently building an abstract LifeCycleManager which will be extended by multiple Applications and I am thinking about my implementation approach. It would be nice to be able to extend an abstract class where both classes could respond to the life cycle invocations.


Reproducible: Always

Steps to Reproduce:
1. Create class with multiple methods annotated with a qualifier
2. Use ContextInjectionFactory.invoke on an object of the class using the qualifier
3. Only the first annotated method found will be called
Comment 1 Christoph Keimel CLA 2012-06-01 07:54:26 EDT
Created attachment 216644 [details]
proposed implementation
Comment 2 Christoph Keimel CLA 2012-06-01 07:54:52 EDT
Created attachment 216645 [details]
usage in E4 life cycle manager