The new implementation portion of the launcher has configuration options, but no tracking of configuration state, nor any way to read that state in from an external source.
Proposed Fix
Introduce a configuration-state class, a configuration ingestion interface with concrete implementations for ingesting from an embedded properties file and command-line arguments, along with any supporting classes needed.
Steps Taken
Added DownstreamParameters (an implementation of javafx.application.Application.Parameters). The purpose of this class is to capture any ingested options not used by the launcher itself for the purpose of passing them along to the downstream application. Also provides a means of retrieving those parameters as a String array to be passed to a main() method.
Added FileFetcher interface, which provides a standardized interface for performing simple I/O. In the original FXLauncher, some of this logic was duplicated in multiple places, and used different return types. This way, every I/O fetch returns an Optional so that consumers can digest fetched data in the same way, no matter how the data was fetched.
Added ClasspathResourceFetcher, an implementation of FileFetcher that fetches a resource off the classpath by its name.
Added ConfigurationIngester abstract class and two concrete implementations: ArgsIngester and PropertiesFileIngester.
Added LoggerConfig and SSLConfig. These are essentially unchanged from the way the original FXLauncher handled these configuration options, except that the logic for each has been isolated into its own class now.
Added LauncherConfig, the implementation of configuration state and state-changing operations.
Problem Statement
The new implementation portion of the launcher has configuration options, but no tracking of configuration state, nor any way to read that state in from an external source.
Proposed Fix
Introduce a configuration-state class, a configuration ingestion interface with concrete implementations for ingesting from an embedded properties file and command-line arguments, along with any supporting classes needed.
Steps Taken
DownstreamParameters
(an implementation ofjavafx.application.Application.Parameters
). The purpose of this class is to capture any ingested options not used by the launcher itself for the purpose of passing them along to the downstream application. Also provides a means of retrieving those parameters as a String array to be passed to amain()
method.FileFetcher
interface, which provides a standardized interface for performing simple I/O. In the original FXLauncher, some of this logic was duplicated in multiple places, and used different return types. This way, every I/O fetch returns an OptionalClasspathResourceFetcher
, an implementation ofFileFetcher
that fetches a resource off the classpath by its name.ConfigurationIngester
abstract class and two concrete implementations:ArgsIngester
andPropertiesFileIngester
.LoggerConfig
andSSLConfig
. These are essentially unchanged from the way the original FXLauncher handled these configuration options, except that the logic for each has been isolated into its own class now.LauncherConfig
, the implementation of configuration state and state-changing operations.