Top Description Fields Constructors Methods
javax.visrec.spi

public abstract Class ServiceProvider

extends Object
Class Inheritance
Imports
java.util.*

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

Field Summary

Modifier and TypeField and Description
private static final Object
LOCK

The lock to populate and mutate the providers list.

private static List<ServiceProvider>

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static List<ServiceProvider>

Returns:

service providers.
available
()

Gets a list of all available ServiceProviders.

public static ServiceProvider

Returns:

service provider.
current
()

Get the current ServiceProvider

public ClassifierFactoryService

Returns:

classifier creator service
getClassifierFactoryService
()

Get the ClassifierFactoryService

public abstract ImageFactoryService

Returns:

image factory service.
getImageFactoryService
()

Get the ImageFactoryService

public abstract ImplementationService

Returns:

implementation service.
getImplementationService
()

Get the ImplementationService

public int

Returns:

The priority (default = 0)
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.

public static void
setCurrent(final ServiceProvider
The ServiceProvider to be set as current.
provider
)

Set the current ServiceProvider

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOCKback to summary
private static final Object LOCK

The lock to populate and mutate the providers list.

providersback to summary
private static List<ServiceProvider> providers

Constructor Detail

ServiceProviderback to summary
protected ServiceProvider()

Method Detail

availableback to summary
public static List<ServiceProvider> available()

Gets a list of all available ServiceProviders.

Returns:List<ServiceProvider>

service providers.

currentback to summary
public static ServiceProvider current()

Get the current ServiceProvider

Returns:ServiceProvider

service provider.

Exceptions
IllegalStateException:
If there are no service providers found.
getClassifierFactoryServiceback to summary
public ClassifierFactoryService getClassifierFactoryService()

Get the ClassifierFactoryService

Returns:ClassifierFactoryService

classifier creator service

getImageFactoryServiceback to summary
public abstract ImageFactoryService getImageFactoryService()

Get the ImageFactoryService

Returns:ImageFactoryService

image factory service.

getImplementationServiceback to summary
public abstract ImplementationService getImplementationService()

Get the ImplementationService

Returns:ImplementationService

implementation service.

getPriorityback to summary
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:int

The priority (default = 0)

setCurrentback to summary
public static void setCurrent(final ServiceProvider provider)

Set the current ServiceProvider

Parameters
provider:ServiceProvider

The ServiceProvider to be set as current.

Exceptions
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.