Interface ContainerStore
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
During the owner's unload (a module reload or the server stopping) the framework calls write on the
unloading thread and then waits on that same thread for the answer, for at most the spec's remaining commit
timeout or the remaining unload wait, whichever comes first. An ordinary module unload has its own approximately
10-second wait; at server stop all modules share approximately 10 seconds, charged only while unloading UI
storage, not while running other module shutdown hooks. Complete the stage without needing the server
thread: during an unload the server thread is the one waiting, and tasks scheduled for it no longer run. Keep
the resources write needs (connections, executors) open until the owner's containers have ended; the
framework ends them before the module's own shutdown code and before its data sources close.
-
Method Summary
Modifier and TypeMethodDescriptionwrite(ContainerSnapshot snapshot) Called once per commit on the container's thread, or on the unloading thread during the owner's unload.
-
Method Details
-
write
Called once per commit on the container's thread, or on the unloading thread during the owner's unload. The returned stage may complete on any thread and must complete with exactly one answer. An answer that does not arrive within the spec's commit timeout, or within the unload's wait, counts asStoreAnswer.Unknownand is ignored when it arrives. Once this is called the store holdssnapshot: after an Unknown answer, including one caused by a timeout or by the unload's wait, the store, not the framework, is responsible for those items (for example a kept, retried write), even if it later decides not to store them. AnswerStoreAnswer.Writtenonly if stored, andStoreAnswer.Refusedonly if the snapshot is not stored and never will be.
-