Interface ServiceEnricher


public interface ServiceEnricher
Provides enriching for services loaded with ServiceLoader
Author:
Lincoln Baxter, III
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> void
    enrich(T service)
    Enrich an instantiated instance of the given service type.
    <T> Collection<T>
    produce(Class<T> type)
    Produce a Collection of enriched services of the given type.
  • Method Details

    • produce

      <T> Collection<T> produce(Class<T> type)
      Produce a Collection of enriched services of the given type. If no instances were produced, this method must return an empty Collection. Only one ServiceEnricher may produce a service at any given time. If more than one ServiceEnricher may produce the same service, only the first will be used.
    • enrich

      <T> void enrich(T service)
      Enrich an instantiated instance of the given service type. If no enriching took place, this method must return the original service without modification. This method is called only when the service was not produced by this ServiceEnricher; in that case, enrichment should have already taken place at the time of production.