public static class EngineWrapper.CloseOnJVMShutdown extends EngineWrapper
Runtime.addShutdownHook(Thread)
If engine was closed by user before JVM shutdown, hook is removed to save memory.EngineWrapper.CloseOnJVMShutdown, EngineWrapper.ImmutabilityCheckEngine, EngineWrapper.ReadOnlyEngine, EngineWrapper.SerializerCheckEngineWrapper, EngineWrapper.SynchronizedEngineWrapper| Modifier and Type | Field and Description |
|---|---|
protected AtomicBoolean |
shutdownHappened |
CLOSEDCATALOG_RECID, CHECK_RECORD, CLASS_INFO_RECID, LAST_RESERVED_RECID| Constructor and Description |
|---|
CloseOnJVMShutdown(Engine engine) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close store/cache.
|
canRollback, canSnapshot, checkClosed, clearCache, closeListenerRegister, closeListenerUnregister, commit, compact, compareAndSwap, delete, get, getSerializerPojo, getWrappedEngine, isClosed, isReadOnly, preallocate, preallocate, put, rollback, snapshot, updateprotected final AtomicBoolean shutdownHappened
public CloseOnJVMShutdown(Engine engine)
public void close()
EngineNullPointerException
There is an configuration option DBMaker.closeOnJvmShutdown() which uses shutdown hook to automatically
close Engine when JVM shutdowns.close in interface Engineclose in class EngineWrapperCopyright © 2024. All rights reserved.