Class ClientConfiguration

java.lang.Object
org.wildfly.client.config.ClientConfiguration

public class ClientConfiguration extends Object
The entry point for generic client configuration.
Author:
David M. Lloyd
  • Method Details

    • getConfigurationUri

      public URI 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 root configuration element 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

      public static ClientConfiguration getInstance(URI configurationUri)
      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

      public static ClientConfiguration getInstance()
      Get a client configuration instance from the current environment. First, the system property wildfly.config.url is 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 called wildfly-config.xml, either in the root of the class loader or within the META-INF folder. 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, null is returned.
      Returns:
      the client configuration instance, or null if no configuration is found
    • getInstance

      public static ClientConfiguration getInstance(ClassLoader classLoader)
      Get a client configuration instance loaded from a file called wildfly-config.xml, either from the root of the specified class loader or within the META-INF folder. If no configurations are found or are loadable, null is returned.
      Parameters:
      classLoader - the class loader from which to load the configuration resource
      Returns:
      the client configuration instance, or null if no configuration is found