ComponentMonitor and Setter Injection

View: New views
1 Messages — Rating Filter:   Alert me  

ComponentMonitor and Setter Injection

by Christopher Oezbek-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Paul,
   I am using the DotDependencyGraphComponentMonitor to draw architecture
diagrams [1] and am wondering if the ComponentMonitor could be extended
with an explicit method call for instances being injected by Setter and
AnnotatedFieldInjection.

At the moment, an injection only triggers a call to  
ComponentMonitor.invoking which is missing the exact injected instance.

I would propose to extend the ComponentMonitor by a method

void injecting(PicoContainer container, ComponentAdapter<?>  
componentAdapter, Member member, Object instance, Object injected);

and call it from IterativeInjector.decorateComponentInstance()

Object toInject = matchingParameters[i].resolveInstance(
    guardedContainer, this, injectionTypes[i],
    makeParameterNameImpl(injectionMembers.get(i)),
    useNames(), bindings[i]);
>>>
componentMonitor.injecting(container, this,
    (Member) member, componentInstance, toInject);
>>>
lastReturn = injectIntoMember(member, componentInstance,
    toInject);
injected[i] = toInject;

This would allow to monitor in detail the actual type of dependencies  
injected via Setter and AnnotatedFieldInjection and allow to draw the  
architecture diagram with static and actual type information.

If this would be of interest I could produce a patch,
   Christopher

[1] https://www.inf.fu-berlin.de/wiki/pub/SE/DPPTechnicals/Saros-r1200.png

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email