commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CONFIGURATION-596) Allow event listener Collections to be lazily created in event.EventSource
Date Sat, 24 Jan 2015 20:09:34 GMT

    [ https://issues.apache.org/jira/browse/CONFIGURATION-596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14290804#comment-14290804
] 

Oliver Heger commented on CONFIGURATION-596:
--------------------------------------------

I am not sure whether there will be another release for Configuration 1.x, so I would propose
focusing on current trunk development. There is a new class {{EventListenerList}} managing
the whole listener registration. It is internally backed by a {{CopyOnWriteArrayList}} as
well.

If you are interested, you can create a patch against this class which implements lazy initialization
of the underlying COWList. Alternatively, it would even be possible to have a custom light-weight
data structure for storing event listeners (in theory, an array treated as immutable and stored
in an atomic reference would do).

I am happy to review and apply patches in this area.
Thanks in advance!

> Allow event listener Collections to be lazily created in event.EventSource
> --------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-596
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-596
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Events & Notifications
>    Affects Versions: 1.9
>            Reporter: Vladimir Sitnikov
>         Attachments: CoWArrayList1.jpg, dataflow_commons_configuration_cowarraylist.png
>
>
> It turns out every instance of {{AbstractConfiguration}} creates a couple of {{CopyOnWriteAraryLists}}
for {{event.EventSource}}.
> In our usage patterns in most of the cases the lists are not used.
> Can the lists be lazy-initialized? (that is created on the first addListener request)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message