Class MagicRuntime.Builder
java.lang.Object
dev.ua.theroer.magicutils.bootstrap.MagicRuntime.Builder
- Enclosing class:
MagicRuntime
Builder for
MagicRuntime.-
Method Summary
Modifier and TypeMethodDescriptionautoRegisterShutdown(boolean autoRegisterShutdown) Controls whether the runtime should auto-register its close hook with the platform.build()Builds a runtime instance.Registers an extra typed component.languageManager(@Nullable LanguageManager languageManager) Sets an optional language manager for the runtime.manage(String name, AutoCloseable closeable) Registers a closeable resource to be closed when the runtime stops.manageConfigManager(boolean manageConfigManager) Controls whether the runtime should callConfigManager.shutdown()on close.Registers a shutdown action.
-
Method Details
-
languageManager
Sets an optional language manager for the runtime.- Parameters:
languageManager- language manager- Returns:
- builder for chaining
-
component
Registers an extra typed component.- Type Parameters:
T- component type- Parameters:
type- component keycomponent- component value- Returns:
- builder for chaining
-
manage
Registers a closeable resource to be closed when the runtime stops.- Parameters:
name- debug labelcloseable- closeable resource- Returns:
- builder for chaining
-
onClose
Registers a shutdown action.- Parameters:
name- debug labelaction- action to execute- Returns:
- builder for chaining
-
manageConfigManager
Controls whether the runtime should callConfigManager.shutdown()on close.- Parameters:
manageConfigManager- true to shutdown the config manager- Returns:
- builder for chaining
-
autoRegisterShutdown
Controls whether the runtime should auto-register its close hook with the platform.- Parameters:
autoRegisterShutdown- true to auto-register withShutdownHookRegistrar- Returns:
- builder for chaining
-
build
-