public abstract class GridUriDeploymentScanner extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
GridUriDeploymentScanner(String gridName,
URI uri,
File deployDir,
long freq,
FilenameFilter filter,
GridUriDeploymentScannerListener lsnr,
org.gridgain.grid.logger.GridLogger log)
Creates new scanner.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels scanner execution.
|
protected File |
createTempFile(String fileName,
File tmpDir)
Creates temp file in temp directory.
|
protected File |
getDeployDirectory()
Gets temporary deployment directory.
|
protected String |
getFileUri(String name)
Gets file URI for the given file name.
|
protected FilenameFilter |
getFilter()
Gets filter for found files.
|
protected long |
getFrequency()
Gets deployment frequency.
|
protected GridUriDeploymentScannerListener |
getListener()
Gets deployment listener.
|
protected org.gridgain.grid.logger.GridLogger |
getLogger()
Gets scanner logger.
|
protected URI |
getUri()
Gets deployment URI.
|
protected boolean |
isCancelled()
Tests whether scanner was cancelled before or not.
|
protected boolean |
isFirstScan()
Tests whether first scan completed or not.
|
void |
join()
Joins scanner thread.
|
protected abstract void |
process()
Scans URI for new, updated or deleted files.
|
void |
start()
Starts scanner.
|
String |
toString() |
protected GridUriDeploymentScanner(String gridName, URI uri, File deployDir, long freq, FilenameFilter filter, GridUriDeploymentScannerListener lsnr, org.gridgain.grid.logger.GridLogger log)
gridName - Grid name.uri - URI which scanner should looks after.deployDir - Temporary deployment directory.freq - Scan frequency.filter - Found files filter.lsnr - Scanner listener which should be notifier about changes.log - Logger.protected abstract void process()
public void start()
public void cancel()
public void join()
protected boolean isCancelled()
true if scanner was cancelled and false
otherwise.protected File createTempFile(String fileName, File tmpDir) throws IOException
fileName - File name.tmpDir - dir to creating file.IOException - if error occur.protected String getFileUri(String name)
uri.name - File name.protected boolean isFirstScan()
true if first scan has been already completed and
false otherwise.protected final URI getUri()
protected final long getFrequency()
protected final File getDeployDirectory()
protected final FilenameFilter getFilter()
lsnr is notified about
changes with certain file last should be accepted by filter.protected final GridUriDeploymentScannerListener getListener()
protected final org.gridgain.grid.logger.GridLogger getLogger()
Copyright © 2014. All rights reserved.