ConfigurationService
is responsible for managing the Configuration
thread locals.
Like this it can be consulted
Accessing configuration
link:../mihxil-math/src/test/java/org/meeuw/test/examples/ConfigurationExample.java[role=include]
...
link:../mihxil-math/src/test/java/org/meeuw/test/examples/ConfigurationExample.java[role=include]
This would however probably mainly be used in implementations.
Actual configuration can be done in two basically distinct ways.
-
a new configuration object can be set as a thread local
-
global default configuration object can be set
temporary overrides
link:../mihxil-math/src/test/java/org/meeuw/test/examples/ConfigurationExample.java[role=include]
There are some utilities in ConfigurationService
that makes this process a bit easier.
temporary overrides utilities
link:../mihxil-math/src/test/java/org/meeuw/test/examples/ConfigurationExample.java[role=include]
Global defaults can be set similarly
setting global defaults
link:../mihxil-math/src/test/java/org/meeuw/test/examples/ConfigurationExample.java[role=include]
ConfigurationService itself is not actually math related, and is released in a separate artifact.