org.sqlite.UnlockNotificationCallback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqlite-javacpp Show documentation
Show all versions of sqlite-javacpp Show documentation
JDBC Driver for SQLite using JavaCPP
The newest version!
package org.sqlite;
import java.util.Map;
import java.util.WeakHashMap;
import org.bytedeco.javacpp.Pointer;
import org.bytedeco.javacpp.PointerPointer;
import org.sqlite.SQLite.sqlite3;
class UnlockNotificationCallback extends UnlockNotifyCallback {
static final UnlockNotificationCallback INSTANCE = new UnlockNotificationCallback();
private final Map unlockNotifications = new WeakHashMap<>();
private UnlockNotificationCallback() {
}
synchronized UnlockNotification add(sqlite3 db) {
return unlockNotifications.computeIfAbsent(db, k -> new UnlockNotification());
}
@Override
public void notify(PointerPointer args, int nArg) {
for (int i = 0; i < nArg; i++) {
UnlockNotification notif = unlockNotifications.get(args.get(i));
notif.fire();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy