|
|
Re: Eclipse4 DI reinject? [message #966919 is a reply to message #966885] |
Thu, 01 November 2012 10:40 |
Eclipse User |
|
|
|
suppose you have
@Inject
public void doStuff(IMyService service){blablabla}
There are two alternatives:
1. you get IMyService through a context function
2. you get it directly from an IEclipseContext
1: If any value in the context which is used to compute the IMyService runtime class changes then the IMyService is reinjected and the method is re-called with the new value
2: If you change it through something like
eclipseContext.set(IMyService.class, myNewServiceObject)
the method is also re-called with the new value.
|
|
|
|
|
|
Re: Eclipse4 DI reinject? [message #967003 is a reply to message #967002] |
Thu, 01 November 2012 12:07 |
Eclipse User |
|
|
|
It depends what you mean by "service stops" do you have a mechanism to null the service in the context when something happens? The framework can not "automatically" check and act when a service "stops" as it is a bit ambiguous what you call stop.
|
|
|
|
|
|
Re: Eclipse4 DI reinject? [message #968235 is a reply to message #967024] |
Fri, 02 November 2012 09:57 |
Eclipse User |
|
|
|
Christoph Keimel wrote on Thu, 01 November 2012 13:26@Sopot: I think you've got a criss-cross in your post : @Optional allows (not prevents) the value to be injected with null
true.
|
|
|
Powered by
FUDForum. Page generated in 0.03899 seconds