Package org.eclipse.steady.java
Class ArchiveAnalysisManager
- java.lang.Object
-
- org.eclipse.steady.java.ArchiveAnalysisManager
-
-
Constructor Summary
Constructors Constructor Description ArchiveAnalysisManager(int _pool_size, long _timeout, boolean _instr, org.eclipse.steady.shared.json.model.Application _ctx)Constructor for ArchiveAnalysisManager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancanAnalyze(File _file)canAnalyze.JarAnalyzergetAnalyzerForSubpath(Path _p)Returns the analyzer used to analyze a Java archive whose path ends with the given sub-path _p (the first match is taken), null if no such analyzer can be found.Set<JarAnalyzer>getAnalyzers()Getter for the fieldanalyzers.org.eclipse.steady.shared.json.model.DependencygetKnownDependency(Path _p)Returns theDependencyfor a given archive, or null if no such archive is known.static String[]getSupportedFileExtensions()getSupportedFileExtensions.voidsetIncludeDir(Path _p)setIncludeDir.voidsetInstrument(boolean _instr)Setter for the fieldinstrument.voidsetKnownDependencies(Map<Path,org.eclipse.steady.shared.json.model.Dependency> _deps)Takes a map of file system paths toDependencys.voidsetLibDir(Path _p)Setter for the fieldlibDir.voidsetRename(boolean _b)Determines whether the instrumented JAR is renamed or not.voidsetWorkDir(Path _p)Setter for the fieldworkDir.voidsetWorkDir(Path _p, boolean _create)Setter for the fieldworkDir.voidstartAnalysis(Map<Path,JarAnalyzer> _paths, JarAnalyzer _parent)voidstartAnalysis(Set<Path> _paths, JarAnalyzer parent)Starts the analysis for all the givenPaths, which must point to either JAR or WAR archives.
-
-
-
Constructor Detail
-
ArchiveAnalysisManager
public ArchiveAnalysisManager(int _pool_size, long _timeout, boolean _instr, org.eclipse.steady.shared.json.model.Application _ctx)Constructor for ArchiveAnalysisManager.
- Parameters:
_pool_size- the number of parallel analysis threads_timeout- the timeout in milleseconds to wait for the completion of all analysis tasks (-1 means no timeout)_instr- whether or not the Java archives shall be instrumented_ctx- the application context in which the analysis takes place (if any)
-
-
Method Detail
-
setInstrument
public void setInstrument(boolean _instr)
Setter for the field
instrument.- Parameters:
_instr- a boolean.
-
setWorkDir
public void setWorkDir(Path _p)
Setter for the field
workDir.- Parameters:
_p- aPathobject.
-
setWorkDir
public void setWorkDir(Path _p, boolean _create)
Setter for the field
workDir.- Parameters:
_p- aPathobject._create- a boolean.
-
setLibDir
public void setLibDir(Path _p)
Setter for the field
libDir.- Parameters:
_p- aPathobject.
-
getSupportedFileExtensions
public static String[] getSupportedFileExtensions()
getSupportedFileExtensions.
- Returns:
- an array of
Stringobjects.
-
canAnalyze
public static final boolean canAnalyze(File _file)
canAnalyze.
- Parameters:
_file- aFileobject.- Returns:
- a boolean.
-
setRename
public void setRename(boolean _b)
Determines whether the instrumented JAR is renamed or not. If yes, the new file name follows the following format: - If app context is provided: [originalJarName]-vulas-[appGroupId]-[appArtifactId]-[appVersion].jar - Otherwise: [originalJarName]-vulas.jar- Parameters:
_b- a boolean.
-
setKnownDependencies
public void setKnownDependencies(Map<Path,org.eclipse.steady.shared.json.model.Dependency> _deps)
Takes a map of file system paths toDependencys. Entries will be used when instantiatingJarAnalyzers instartAnalysis(Set, JarAnalyzer).- Parameters:
_deps- aMapobject.
-
getKnownDependency
public org.eclipse.steady.shared.json.model.Dependency getKnownDependency(Path _p)
Returns theDependencyfor a given archive, or null if no such archive is known. The underlying map is built during the execution of the Maven plugin.- Parameters:
_p- aPathobject.- Returns:
- a
Dependencyobject.
-
startAnalysis
public void startAnalysis(@NotNull Map<Path,JarAnalyzer> _paths, JarAnalyzer _parent)Starts the analysis for allPaths of the givenMapthat have a null value. As such, it can be used to avoid analyzing archives multiple times.- Parameters:
_paths- aMapobject._parent- aJarAnalyzerobject.
-
startAnalysis
public void startAnalysis(@NotNull Set<Path> _paths, JarAnalyzer parent)Starts the analysis for all the givenPaths, which must point to either JAR or WAR archives.- Parameters:
_paths- aSetobject.parent- aJarAnalyzerobject.
-
getAnalyzers
public Set<JarAnalyzer> getAnalyzers()
Getter for the field
analyzers.- Returns:
- a
Setobject.
-
getAnalyzerForSubpath
public JarAnalyzer getAnalyzerForSubpath(Path _p)
Returns the analyzer used to analyze a Java archive whose path ends with the given sub-path _p (the first match is taken), null if no such analyzer can be found.- Parameters:
_p- aPathobject.- Returns:
- a
JarAnalyzerobject.
-
-