Skip to content

Commit

Permalink
Issue #5086 Review and rework o.e.j.util.Scanner
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Bartel <[email protected]>
  • Loading branch information
janbartel committed Dec 1, 2020
1 parent 7b77a53 commit 4883332
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 330 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.eclipse.jetty.ant.types.Connector;
import org.eclipse.jetty.ant.types.ContextHandlers;
Expand Down Expand Up @@ -135,7 +136,7 @@ public WebAppScannerListener(AntWebAppContext awc)
}

@Override
public void filesChanged(List<String> changedFileNames)
public void filesChanged(Set<String> changedFileNames)
{
boolean isScanned = false;
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ protected void doStart() throws Exception
_scanner = new Scanner();
_scanner.setScanDirs(files);
_scanner.setScanInterval(_scanInterval);
_scanner.setRecursive(_recursive);
_scanner.setFilenameFilter(_filenameFilter);
_scanner.setReportDirs(true);
_scanner.setScanDepth(1); //consider direct dir children of monitored dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ public void setupEnvironment() throws Exception
if (provider instanceof ScanningAppProvider)
{
_providers++;
((ScanningAppProvider)provider).addScannerListener(new Scanner.ScanListener()
((ScanningAppProvider)provider).addScannerListener(new Scanner.ScanCycleListener()
{
@Override
public void scan()
public void scanStarted(int cycle)
{
}

@Override
public void scanEnded(int cycle)
{
_scans.incrementAndGet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.util.Date;
import java.util.List;
import java.util.Set;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
Expand Down Expand Up @@ -191,7 +191,7 @@ protected void configureScanner()
}
scanner.addListener(new Scanner.BulkListener()
{
public void filesChanged(List<String> changes)
public void filesChanged(Set<String> changes)
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Date;
import java.util.List;
import java.util.Set;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Execute;
Expand Down Expand Up @@ -197,7 +197,7 @@ public void configureScanner() throws MojoExecutionException
configureScanTargetPatterns(scanner);
scanner.addListener(new Scanner.BulkListener()
{
public void filesChanged(List<String> changes)
public void filesChanged(Set<String> changes)
{
try
{
Expand Down
Loading

0 comments on commit 4883332

Please sign in to comment.