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 class
The module containing the services. -
Constructor Summary
ConstructorsConstructorDescriptionServiceFinder
(Class serviceType) Constructor.ServiceFinder
(String serviceName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSearchPath
(Path path) Adds a search (directory) path.void
addSearchPaths
(Path... paths) Adds search (directory) paths.void
Adds search paths from user preferences.void
addSearchPathsFromPreferences
(String configName, String key) Adds search paths from user preferences.Finds services based on the current search path configuration.boolean
boolean
void
setUseClassPath
(boolean value) void
setUseZipFiles
(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:
true
if 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:
true
if 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.
-