javax.visrec.spi

## Class ServiceProvider

- java.lang.Object
- - javax.visrec.spi.ServiceProvider

    public abstract class ServiceProvider
    extends Object

The ServiceProvider is the centralized provider to provide API scoped services.

Since:
  1.0
Author:
  Werner Keil, Martin Desruisseaux, Kevin Berendsen

### Constructor Summary

Constructors
`protected` `ServiceProvider()`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`static List<ServiceProvider>` `available()` Gets a list of all available `ServiceProvider`s.
`static ServiceProvider` `current()` Get the current `ServiceProvider`
`abstract BuilderService` `getBuilderService()` Get the `BuilderService`
`abstract ClassifierService` `getClassifierService()` Get the `ClassifierService`
`abstract ImageFactoryService` `getImageFactoryService()` Get the `ImageFactoryService`
`abstract ImplementationService` `getImplementationService()` Get the `ImplementationService`
`int` `getPriority()` If multiple implementations of the `ServiceProvider` are found on the classpath, then the `ServiceProvider` with the highest value of priority will be used by default.
`static void` `setCurrent(ServiceProvider provider)` Set the current `ServiceProvider`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ServiceProvider

    protected ServiceProvider()

### Method Detail

#### getPriority

    public int getPriority()

If multiple implementations of the `ServiceProvider` are found on the classpath, then the `ServiceProvider` with the highest value of priority will be used by default.

Returns:
  The priority (default = 0)

#### getBuilderService

    public abstract BuilderService getBuilderService()

Get the `BuilderService`

Returns:
  builder service.

#### getClassifierService

    public abstract ClassifierService getClassifierService()

Get the `ClassifierService`

Returns:
  classifier service

#### getImageFactoryService

    public abstract ImageFactoryService getImageFactoryService()

Get the `ImageFactoryService`

Returns:
  image factory service.

#### getImplementationService

    public abstract ImplementationService getImplementationService()

Get the `ImplementationService`

Returns:
  implementation service.

#### current

    public static ServiceProvider current()

Get the current `ServiceProvider`

Returns:
  service provider.
Throws:
  `IllegalStateException` - If there are no service providers found.

#### setCurrent

    public static void setCurrent(ServiceProvider provider)

Set the current `ServiceProvider`

Parameters:
  `provider` - The `ServiceProvider` to be set as current.
Throws:
  `IllegalStateException` - If there are no service providers found.
  `IllegalArgumentException` - If the `ServiceProvider` given by the parameters is not known in the existing list of providers.

#### available

    public static List<ServiceProvider> available()

Gets a list of all available `ServiceProvider`s.

Returns:
  service providers.