Class Sabi
java.lang.Object
com.github.sttk.sabi.Sabi
Utility class for managing and setting up global
DataSrc instances.
Applications can register global data sources using uses(String, DataSrc) during
startup, and then call setup() or setup(String...) to set them up. The returned
AutoCloseable handles shutting down and closing global data sources when the application
terminates or finishes using them.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AutoCloseablesetup()Sets up all registered global data sources in their registration order.static AutoCloseableSets up registered global data sources matching the specified names in the given order.static AutoCloseableSets up registered global data sources matching the specified list of names in the given order.static voidRegisters a global data source with the specified logical name.
-
Method Details
-
uses
-
setup
Sets up all registered global data sources in their registration order.- Returns:
- an
AutoCloseablethat closes all initialized global data sources when closed - Throws:
com.github.sttk.errs.Err- if setting up any global data source fails
-
setup
Sets up registered global data sources matching the specified names in the given order.- Parameters:
names- varargs array of global data source names to set up- Returns:
- an
AutoCloseablethat closes the set-up global data sources when closed - Throws:
com.github.sttk.errs.Err- if setting up any of the specified global data sources fails
-
setup
Sets up registered global data sources matching the specified list of names in the given order.- Parameters:
names- list of global data source names to set up- Returns:
- an
AutoCloseablethat closes the set-up global data sources when closed - Throws:
com.github.sttk.errs.Err- if setting up any of the specified global data sources fails
-