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
Dbdatabase - Getting system constants like the database directory
- Getting the system
ExecutorServicefor starting threads or anActionQueue - Getting a
FullSystemobject, which has - the
WebFramework, which registers endpoints - the
TheBrig, which handles bad actors on the internet
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis is a helper method to instantiate aDbclass, avoiding the need for a user to provide the root database directory and the context.This is a helper method to instantiate aDbEngine2class, using the engine2 database implementation.voidsetFullSystem(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 aDbclass, 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 theDbDatadata. This is used in the Db code to deserialize the data when reading.
-
getDb2
This is a helper method to instantiate aDbEngine2class, using the engine2 database implementation. It is similar togetDb(String, DbData)in all other respects.By switching your old database calls to use this, when it runs it will convert the file schema.
Please backup your database before conversion
-