User Tools

Site Tools


handlers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
handlers [2014/01/16 09:07]
mihael
handlers [2014/01/16 09:11] (current)
mihael
Line 4: Line 4:
 The run method should **not** be annotated with ''​@Inject''​ because on every action which requires Inject all methods annotated with ''​@Inject''​ will be executed, even the run method if it is annotated with ''​@Inject''​. The run method should **not** be annotated with ''​@Inject''​ because on every action which requires Inject all methods annotated with ''​@Inject''​ will be executed, even the run method if it is annotated with ''​@Inject''​.
  
-http://​wiki.eclipse.org/​Eclipse4/​RCP/​FAQ#​Why_aren.27t_my_handler_fields_being_re-injected.3F+===== Field Injection ===== 
 +Handlers should not use field injection (''​@Inject''​ on fields) because handlers are created as singletons very early in the application lifecycle and fields cannot be reinjected.,​ see http://​wiki.eclipse.org/​Eclipse4/​RCP/​FAQ#​Why_aren.27t_my_handler_fields_being_re-injected.3F 
 + 
 +<note tip>But it is safe to use method injection on the execution method of the handler.</​note>​
  
 {{tag>​e4}} {{tag>​e4}}
handlers.txt · Last modified: 2014/01/16 09:11 by mihael