You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Alla Gofman (Jira)" <ji...@apache.org> on 2023/01/23 10:18:00 UTC
[jira] [Comment Edited] (CONFIGURATION-827) Enable to set custom AutoSaveListener
[ https://issues.apache.org/jira/browse/CONFIGURATION-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679594#comment-17679594 ]
Alla Gofman edited comment on CONFIGURATION-827 at 1/23/23 10:17 AM:
---------------------------------------------------------------------
I tried to register listener like this:
builder.getFileHandler().addFileHandlerListener(new FileHandlerListenerAdapter() {
@Override
public void saving(final FileHandler handler)
{ ... }
});
*This doesn't work, because*
AutoSaveListener calls updateFileHandler(final FileHandler fh) and FileHandler replaced by new instance.
was (Author: allag):
What I did is:
builder.getFileHandler().addFileHandlerListener(new FileHandlerListenerAdapter() {
@Override
public void saving(final FileHandler handler) {
...
}
});
> Enable to set custom AutoSaveListener
> -------------------------------------
>
> Key: CONFIGURATION-827
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-827
> Project: Commons Configuration
> Issue Type: Bug
> Components: File reloading
> Affects Versions: 2.8.0
> Reporter: Alla Gofman
> Priority: Major
>
> I would like to extend AutoSaveListener (which package private)
> 1) override onEvent(final ConfigurationEvent event) behavior and set the custom listener in FileBasedConfigurationBuilder.
> 2) register custom AutoSaveListener for saving() event.
> Both unavailable.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)