Package org.esa.snap.core.util
Class ServiceFinder
java.lang.Object
org.esa.snap.core.util.ServiceFinder
A finder for service provider interface (SPI) registries.
- Since:
- SNAP 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe module containing the services. -
Constructor Summary
ConstructorsConstructorDescriptionServiceFinder(Class serviceType) Constructor.ServiceFinder(String serviceName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSearchPath(Path path) Adds a search (directory) path.voidaddSearchPaths(Path... paths) Adds search (directory) paths.voidAdds search paths from user preferences.voidaddSearchPathsFromPreferences(String configName, String key) Adds search paths from user preferences.Finds services based on the current search path configuration.booleanbooleanvoidsetUseClassPath(boolean value) voidsetUseZipFiles(boolean value)
-
Constructor Details
-
ServiceFinder
Constructor.- Parameters:
serviceType- The service type or service provider interface (SPI).
-
ServiceFinder
Constructor.- Parameters:
serviceName- The service's name.
-
-
Method Details
-
getServicesPath
- Returns:
- The service's path.
-
getUseClassPath
public boolean getUseClassPath()- Returns:
trueif this ServiceFinder uses the JVM's class path´to find modules.
-
setUseClassPath
public void setUseClassPath(boolean value) - Parameters:
value- Iftrue, the JVM's class path shall be searched as well
-
getUseZipFiles
public boolean getUseZipFiles()- Returns:
trueif this ServiceFinder uses the JVM's class path to find modules.
-
setUseZipFiles
public void setUseZipFiles(boolean value) - Parameters:
value- Iftrue, any ZIP and JAR files are searched as well
-
getSearchPaths
- Returns:
- The list of search paths.
-
addSearchPath
Adds a search (directory) path.- Parameters:
path- A search path.
-
addSearchPaths
Adds search (directory) paths.- Parameters:
paths- The search paths.
-
addSearchPathsFromPreferences
Adds search paths from user preferences. The value is be a colon- (Unix) or semicolon-separated list of (directory) paths.- Parameters:
configName- The configuration name.key- The user preferences key.
-
addSearchPathsFromPreferences
Adds search paths from user preferences. The value is be a colon- (Unix) or semicolon-separated list of (directory) paths.- Parameters:
key- The user preferences key.
-
findServices
Finds services based on the current search path configuration.- Returns:
- List of modules providing the services.
-