java.lang.Object
com.renomad.minum.state.Context
Holds important system-wide data and methods, such as the
logger, constants, and the
FullSystem
instance.
The common situations:
- Building a Minum
Db
database - Getting system constants like the database directory
- Getting the system
ExecutorService
for starting threads or anActionQueue
- Getting a
FullSystem
object, which has - the
WebFramework
, which registers endpoints - the
TheBrig
, which handles bad actors on the internet
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThis is a helper method to instantiate aDb
class, avoiding the need for a user to provide the root database directory and the context.void
setFullSystem
(FullSystem fullSystem) void
-
Field Details
-
EMPTY
-
-
Constructor Details
-
Context
-
-
Method Details
-
setLogger
-
getLogger
-
getExecutorService
-
getConstants
-
setFullSystem
-
getFullSystem
-
getActionQueueState
-
getDb
This is a helper method to instantiate aDb
class, avoiding the need for a user to provide the root database directory and the context.Since this is a generic method, a bit of care is required when calling. Try to use a pattern like the following pseudocode:
Db<Photograph> photoDb = context.getDb("photos", new Photograph());
- Parameters:
name
- the name of this data. Note that this will be used as the directory for the data, so use characters your operating system would allow.instance
- an instance of theDbData
data. This is used in the Db code to deserialize the data when reading.
-