[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[riena-dev] Once-Only feature for the service and extension injector
|
Hi,
While looking for issues within our injectors I found a
performance/memory problem. As you might know Riena automaticaly wires
instances (i.e. performs service/extension injection) which get
instantiated from extensions. This is very nice and convenient.
However, there are cases where instances of the same class are created
over and over again (e.g. when ever a ridget is created) and of course
they get wired - again and again. This is neither bad nor wrong!
Everything works. But for each instance where a service or an extension
has been injected Riena keeps track and creates service or extension
registry listeners to do that.
For this one case (multiple instances of the same class) an optimization
would be possible, because those instances could share the injected
services/extensions and thus require less registry listeners.
To allow such an optimization to take place the service and extension
injectors support now a "once only" feature. This can be activated by
either declaring the injection methods (bind/unbind, update) as static
or by setting the 'onceOnly' attribute of the annotations @InjectService
or @InjectExtension to true.
With this the injectors will only inject once. The injectors will of
course still keep track of services and extensions that come and go -
but only once. When you do so, you are now responsible for sharing this
information between those instances.
Please watch for issues that could have been affected by this change and
report them as soon as possible.
Tschüß,
Stefan
-------------------------------------------------------------
compeople AG
Untermainanlage 8
60329 Frankfurt/Main
fon: 069 / 27 22 18 0
fax: 069 / 27 22 18 22
web: www.compeople.de
Vorstand: Jürgen Wiesmaier
Aufsichtsratsvorsitzender: Christian Glanz
Sitz der Gesellschaft: Frankfurt/Main
Handelsregister Frankfurt HRB 56759
Ust-Ident.-Nr: DE207665352
-------------------------------------------------------------