SrvStateManager for the stand-alone HTTP server.
The server serves a fixed set of libraries known at startup. Each one is parsed
once in the constructor, an in-memory SearchContext is built for it, and the
(BibDatabaseContext, mtime) pair is held for the lifetime of the process.
Because nothing watches the files asynchronously (jabsrv uses
DummyFileUpdateMonitor everywhere), getOpenDatabases does a per-call
stat on every tracked file and re-parses any that changed on disk since the
last observation. The cost is one stat per library per request; only an actual
modification triggers re-parsing. This is the cheap middle ground between
"snapshot at startup" (broken when the user edits a .bib externally) and
running a real org. thread.
There is no Postgres path: the in-memory backend has no startup cost, and the
toggle is hardwired to false.
| Modifier and Type | Field and Description |
|---|---|
| private final BibEntryPreferences | |
| private final BibtexImporter | |
| private final Map | |
| private static final Logger | |
| private final ObservableList |
| Access | Constructor and Description |
|---|---|
| public | JabRefSrvStateManager(BibEntryPreferences bibEntryPreferences, ImportFormatPreferences importFormatPreferences, List<Path> files)
|
| Modifier and Type | Method and Description |
|---|---|
| public org.jabref.logic.util.OptionalObjectProperty | |
| public Optional | |
| public ObjectBinding | |
| public synchronized List | |
| public synchronized ObservableList | getOpenDatabases()
Implements org. Returns an unmodifiable snapshot of the open libraries. |
| public ObservableList | |
| private Optional | |
| private void | refreshStaleLibraries()
Compares each tracked file's current mtime against the snapshot taken at the last parse. |
| private void |
| bibEntryPreferences | back to summary |
|---|---|
| private final BibEntryPreferences bibEntryPreferences | |
| importer | back to summary |
|---|---|
| private final BibtexImporter importer | |
| lastModified | back to summary |
|---|---|
| private final Map<Path, FileTime> lastModified | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| openDatabases | back to summary |
|---|---|
| private final ObservableList<BibDatabaseContext> openDatabases | |
| JabRefSrvStateManager | back to summary |
|---|---|
| public JabRefSrvStateManager(BibEntryPreferences bibEntryPreferences, ImportFormatPreferences importFormatPreferences, List<Path> files) | |
| activeDatabaseProperty | back to summary |
|---|---|
| public org.jabref.logic.util.OptionalObjectProperty Implements org.
| |
| getActiveDatabase | back to summary |
|---|---|
| public Optional Implements org.
| |
| getActiveSelectionTabProperty | back to summary |
|---|---|
| public ObjectBinding Implements org.
| |
| getAllDatabasePaths | back to summary |
|---|---|
| public synchronized List Implements org.
| |
| getOpenDatabases | back to summary |
|---|---|
| public synchronized ObservableList Implements org. Returns an unmodifiable snapshot of the open libraries. Grizzly/Jersey serve requests concurrently and several resources call
| |
| getSelectedEntries | back to summary |
|---|---|
| public ObservableList Implements org.
| |
| parseLibrary | back to summary |
|---|---|
| private Optional Parses a single library. A library that fails to parse is logged and skipped. | |
| refreshStaleLibraries | back to summary |
|---|---|
| private void refreshStaleLibraries() Compares each tracked file's current mtime against the snapshot taken at
the last parse. If it changed, the library is re-parsed, the context in
| |
| registerSearchContext | back to summary |
|---|---|
| private void registerSearchContext(BibDatabaseContext database) | |