Package org.freecompany.util.services

The discovery mechanism allows Java source code to discover and utilize interchangeable service provider implementations.

See:
          Description

Class Summary
ServiceDiscovery The discovery class provides factory methods for creating instances of service information objects and a caching mechanism.
ServiceInfo A service information object provides an interface that can be used to query for provider instances defined in system properties, system wide JVM settings, or service descriptors in the class path.
 

Package org.freecompany.util.services Description

The discovery mechanism allows Java source code to discover and utilize interchangeable service provider implementations.

The service provider interface allows application code to be loosely coupled to a particular service implementation while providing several mechanisms for providers to be added or replaced by the user or system administrator without requiring a corresponding application code change.

When a system is specified, the helper utility will first attempt to load a properties file in the lib directory within the Java home directory named as the system identifier followed by .properties, i.e. net specific provider information will be specified in the file $JAVA_HOME/lib/net.properties.

Next the helper will check the system properties for an overriding provider. If a property exists named the same as the fully qualifies class name of the provider service class, the value is used as a concrete implementation class name.

Finally the helper searches either the current loader or a given class loader for service descriptor files under a common directory, as defined by the JAR specification.

See Also:
JAR Services Specification