Sets up the wallet to auto-save itself to the given file, using temp files with atomic renames to ensure
consistency. After connecting to a file, you no longer need to save the wallet manually, it will do it
whenever necessary. Protocol buffer serialization will be used.
If delayTime is set, a background thread will be created and the wallet will only be saved to
disk every so many time units. If no changes have occurred for the given time period, nothing will be written.
In this way disk IO can be rate limited. It's a good idea to set this as otherwise the wallet can change very
frequently, eg if there are a lot of transactions in it or during block sync, and there will be a lot of redundant
writes. Note that when a new key is added, that always results in an immediate save regardless of
delayTime. You should still save the wallet manually when your program is about to shut down as the JVM
will not wait for the background thread.
An event listener can be provided. If a delay >0 was specified, it will be called on a background thread
with the wallet locked when an auto-save occurs. If delay is zero or you do something that always triggers
an immediate save, like adding a key, the event listener will be invoked on the calling threads.