OCPsoft Common API 1.0.5.Final

org.ocpsoft.common.spi
Interface ServiceEnricher


public interface ServiceEnricher

Provides enriching for services loaded with ServiceLoader

Author:
Lincoln Baxter, III

Method Summary
<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 Detail

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.


OCPsoft Common API 1.0.5.Final

Copyright © 2012 OCPsoft. All Rights Reserved.