Package: org.apache.groovy.contracts.util

## [Java] Class LifecycleImplementationLoader<S>

- org.apache.groovy.contracts.util.LifecycleImplementationLoader

- All Implemented Interfaces and Traits:
    Iterable

      public final class LifecycleImplementationLoader<S>
      extends Object
      implements Iterable

  Finds and loads implementation classes of interface Lifecycle.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Iterator<S>` | `iterator()` Returns an iterator over already loaded providers followed by lazily discovered providers.
    `<S>` | `public static LifecycleImplementationLoader<S>` | `load(Class<S> service, ClassLoader loader)` Creates a new Lifecycle for the given type and class loader.
    `` | `public void` | `reload()` Clears cached providers and restarts service discovery.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public Iterator<S> iterator()

      Returns an iterator over already loaded providers followed by lazily discovered providers.

      Returns:
        an iterator across provider instances

    - #### <S> public static LifecycleImplementationLoader<S> load(Class<S> service, ClassLoader loader)

      Creates a new Lifecycle for the given type and class loader.

      Parameters:
        `service` - the service type to load
        `loader` - the class loader used to discover providers
      Type Parameters:
        `S` - the service type
      Returns:
        a loader for the requested service type

    - #### public void reload()

      Clears cached providers and restarts service discovery.