public abstract class LayerScanner
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Class and Description |
---|---|
static interface |
LayerScanner.Callback
Interface that may be implemented to receive error, debugging, etc callbacks from this layer
scanner.
|
static interface |
LayerScanner.Spi |
Modifier and Type | Field and Description |
---|---|
protected boolean |
canceled |
protected LocalRasterDataStore |
database |
protected java.lang.String |
name |
Modifier | Constructor and Description |
---|---|
protected |
LayerScanner(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Instructs the scanner to terminate scanning as soon as possible.
|
protected void |
cancelImpl()
Subclasses may override this method to perform any additional activities that are required
for cancelling the scan.
|
protected void |
debug(java.lang.String msg)
Subclasses should invoke to log a debug message with the owning
ScanLayersService instance. |
protected void |
error(java.lang.String msg)
Subclasses should invoke to log an error message with the owning
ScanLayersService instance. |
java.lang.String |
getName()
Returns the name of the scanner.
|
protected void |
layerDiscovered(DatasetDescriptor layer)
Subclasses should invoke when a layer is discovered while scanning.
|
void |
prepare(LayerScanner.Callback callback)
Invoked immediately before the enclosing
Thread is started. |
protected void |
progress(java.lang.String msg) |
abstract void |
reset()
Instructs the scanner to reset any state or cache information prior to initiating a scan.
|
abstract void |
run() |
protected final java.lang.String name
protected boolean canceled
protected LocalRasterDataStore database
public void prepare(LayerScanner.Callback callback)
Thread
is started.callback
- The interface to be used for logging, error, etc callbacks.protected void layerDiscovered(DatasetDescriptor layer)
layer
- The layer that was discovered.protected void error(java.lang.String msg)
ScanLayersService
instance.msg
- The error messageprotected void debug(java.lang.String msg)
ScanLayersService
instance.msg
- The debug messageprotected void progress(java.lang.String msg)
public final void cancel()
protected void cancelImpl()
IMPORTANT: This method should not block.
public abstract void reset()
public final java.lang.String getName()
public abstract void run()
run
in interface java.lang.Runnable