public class WalletFiles
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
WalletFiles.Listener
Implementors can do pre/post treatment of the wallet file.
|
Constructor and Description |
---|
WalletFiles(Wallet wallet,
java.io.File file,
long delay,
java.util.concurrent.TimeUnit delayTimeUnit)
Initialize atomic and optionally delayed writing of the wallet file to disk.
|
Modifier and Type | Method and Description |
---|---|
Wallet |
getWallet()
Get the
Wallet this WalletFiles is managing. |
void |
saveLater()
Queues up a save in the background.
|
void |
saveNow()
Actually write the wallet file to disk, using an atomic rename when possible.
|
void |
setListener(WalletFiles.Listener listener)
The given listener will be called on the autosave thread before and after the wallet is saved to disk.
|
void |
shutdownAndWait()
Shut down auto-saving.
|
public WalletFiles(Wallet wallet, java.io.File file, long delay, java.util.concurrent.TimeUnit delayTimeUnit)
Wallet
calls saveNow()
or saveLater()
as wallet state changes,
depending on the urgency of the changes.public Wallet getWallet()
Wallet
this WalletFiles
is managing.public void setListener(@Nonnull WalletFiles.Listener listener)
public void saveNow() throws java.io.IOException
java.io.IOException
public void saveLater()
public void shutdownAndWait()