Interface Loader


public interface Loader
A loader of configuration-related objects.

The loader resolves configuration data of the provided configuration interface with a portion of application's persistent configuration identified by configuration path. The portion of the persistent configuration is identified by configuration path.

The loader must support persistent configuration stored in META-INF/jakarta-config.properties file found on the classpath that follows a format that is recognized by the class Properties.

In the following example the MyConfigurationRelatedObject is the configuration interface to be resolved. An instance of the configuration interface is created by the Loader:

 Loader loader = Loader.bootstrap();
MyConfigurationRelatedObject object = null;
try {
  object = loader
             .path("my.configuration")
             .load(MyConfigurationRelatedObject.class);
} catch (NoSuchObjectException noSuchObjectException) {
  // object is absent
} catch (ConfigException configException) {
  // a loading-related error occurred
}

Implementations of the methods in this class must be:

  • idempotent
  • safe for concurrent use by multiple threads
  • must not return null.
See Also: