java.lang.Object
com.adventure.config.ApplicationContextProvider
- All Implemented Interfaces:
ApplicationContext
This class implements a singleton pattern.
The responsibility of this class is to provide a context object in the whole application.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.apache.logging.log4j.LoggerLogger. -
Method Summary
Modifier and TypeMethodDescriptionApplication configuration getter.getGame()Game getter.static ApplicationContextProviderSingleton getter.voidGame setter.
-
Field Details
-
logger
protected static final org.apache.logging.log4j.Logger loggerLogger.
-
-
Method Details
-
getInstance
Singleton getter. Returns null if the configuration file is not found.- Returns:
- Singleton instance.
-
getGame
Game getter.- Specified by:
getGamein interfaceApplicationContext- Returns:
- Game.
-
getConfig
Application configuration getter.- Specified by:
getConfigin interfaceApplicationContext- Returns:
- Current application config.
-
setGame
Game setter.- Specified by:
setGamein interfaceApplicationContext- Parameters:
game- Game.
-