Package org.esa.snap.core.util
Class ServiceFinder
- java.lang.Object
-
- org.esa.snap.core.util.ServiceFinder
-
public class ServiceFinder extends Object
A finder for service provider interface (SPI) registries.- Since:
- SNAP 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classServiceFinder.ModuleThe module containing the services.
-
Constructor Summary
Constructors Constructor Description ServiceFinder(Class serviceType)Constructor.ServiceFinder(String serviceName)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSearchPath(Path path)Adds a search (directory) path.voidaddSearchPaths(Path... paths)Adds search (directory) paths.voidaddSearchPathsFromPreferences(String key)Adds search paths from user preferences.voidaddSearchPathsFromPreferences(String configName, String key)Adds search paths from user preferences.List<ServiceFinder.Module>findServices()Finds services based on the current search path configuration.List<Path>getSearchPaths()StringgetServicesPath()booleangetUseClassPath()booleangetUseZipFiles()voidsetUseClassPath(boolean value)voidsetUseZipFiles(boolean value)
-
-
-
Method Detail
-
getServicesPath
public String 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
-
addSearchPath
public void addSearchPath(Path path)
Adds a search (directory) path.- Parameters:
path- A search path.
-
addSearchPaths
public void addSearchPaths(Path... paths)
Adds search (directory) paths.- Parameters:
paths- The search paths.
-
addSearchPathsFromPreferences
public void addSearchPathsFromPreferences(String configName, String key)
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
public void addSearchPathsFromPreferences(String key)
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
public List<ServiceFinder.Module> findServices()
Finds services based on the current search path configuration.- Returns:
- List of modules providing the services.
-
-