Package org.wildfly.client.config
Class ClientConfiguration
java.lang.Object
org.wildfly.client.config.ClientConfiguration
The entry point for generic client configuration.
- Author:
- David M. Lloyd
-
Method Summary
Modifier and TypeMethodDescriptionGet the URI from which the configuration is being read.static ClientConfigurationGet a client configuration instance from the current environment.static ClientConfigurationgetInstance(ClassLoader classLoader) Get a client configuration instance loaded from a file calledwildfly-config.xml, either from the root of the specified class loader or within theMETA-INFfolder.static ClientConfigurationgetInstance(URI configurationUri) Get a client configuration instance for a certain URI.static ClientConfigurationgetInstance(URI configurationUri, ExceptionSupplier<InputStream, IOException> streamSupplier) Get a client configuration instance for a certain URI, with streams provided by the given supplier.readConfiguration(Set<String> recognizedNamespaces) Get a stream reader over a configuration.
-
Method Details
-
getConfigurationUri
Get the URI from which the configuration is being read.- Returns:
- the URI from which the configuration is being read
-
readConfiguration
public ConfigurationXMLStreamReader readConfiguration(Set<String> recognizedNamespaces) throws ConfigXMLParseException Get a stream reader over a configuration. The configuration returned will be the first element within the rootconfigurationelement which has a namespace corresponding to one of the given namespaces.- Parameters:
recognizedNamespaces- the recognized namespaces- Returns:
- a reader which returns the first matching element
- Throws:
ConfigXMLParseException- if a read error occurs
-
getInstance
Get a client configuration instance for a certain URI.- Parameters:
configurationUri- the configuration URI- Returns:
- the client configuration instance
-
getInstance
public static ClientConfiguration getInstance(URI configurationUri, ExceptionSupplier<InputStream, IOException> streamSupplier) Get a client configuration instance for a certain URI, with streams provided by the given supplier.- Parameters:
configurationUri- the configuration URI- Returns:
- the client configuration instance
-
getInstance
Get a client configuration instance from the current environment. First, the system propertywildfly.config.urlis checked. If present, the configuration file is taken from that URL (which is resolved against the current working directory if it is a relative URL or a bare path). If the property is not given, the current thread's context class loader is consulted for a file calledwildfly-config.xml, either in the root of the class loader or within theMETA-INFfolder. If no such resource is found, the same search is done against the class loader of this library. Finally, if no configurations are found or are loadable,nullis returned.- Returns:
- the client configuration instance, or
nullif no configuration is found
-
getInstance
Get a client configuration instance loaded from a file calledwildfly-config.xml, either from the root of the specified class loader or within theMETA-INFfolder. If no configurations are found or are loadable,nullis returned.- Parameters:
classLoader- the class loader from which to load the configuration resource- Returns:
- the client configuration instance, or
nullif no configuration is found
-