public class IgnoreFileProcessor extends java.lang.Object implements ExtensionsFileProcessor
The first step is executed via the manager:
ExtensionsManager.processFiles(ExtensionsFileProcessor)
and should be done before the UninstalledFileProcessor
is exectued.
The second step is either automatically executed when all files
have been processed or by calling finalizeRegistration(ExtensionsManager)
and should be done as the last step of the installation procedure.
Modifier and Type | Field and Description |
---|---|
private boolean |
delayRegistration |
private java.util.Set<ExtensionsFile.WriteableExtensionsFile> |
filesToIgnore |
private int |
numFiles |
private ProcessResults |
results |
Constructor and Description |
---|
IgnoreFileProcessor(ProcessResults results) |
Modifier and Type | Method and Description |
---|---|
void |
begin(ExtensionsManager manager,
int numFiles)
Called by the extensions manager before the processing starts.
|
void |
done(ExtensionsManager manager)
Called by the extensions manager after a successful completion of the
processing.
|
void |
done(ExtensionsManager manager,
java.lang.Throwable t)
Called by the extensions manager if an exception was thrown
by the processor.
|
void |
finalizeRegistration(ExtensionsManager manager)
Finalize the ignore registration.
|
int |
getNumFiles()
Get the number of files that was processed.
|
boolean |
isRegistrationDelayed()
Is the actual registration delayed or not?
|
void |
processFile(ExtensionsManager manager,
ExtensionsFile.WriteableExtensionsFile wFile)
Called by the extensions manager for each extensions file that it
manages.
|
void |
setDelayRegistration(boolean delayRegistration)
Set a flag to indicate if the actual registration of the found
extensions and extension points should be delayed or not.
|
private final ProcessResults results
private java.util.Set<ExtensionsFile.WriteableExtensionsFile> filesToIgnore
private int numFiles
private boolean delayRegistration
public IgnoreFileProcessor(ProcessResults results)
public void begin(ExtensionsManager manager, int numFiles)
ExtensionsFileProcessor
begin
in interface ExtensionsFileProcessor
manager
- The manager that is executing the actionnumFiles
- The number of extension files that is going to be processed this timepublic void processFile(ExtensionsManager manager, ExtensionsFile.WriteableExtensionsFile wFile)
ExtensionsFileProcessor
If the processor throws an exception the manager will abort
processing and call ExtensionsFileProcessor.done(ExtensionsManager, Throwable)
.
Error that are related to a specific file should be catched
by the processor and registered by calling .......
If all files was processed without exceptions the manager
will call ExtensionsFileProcessor.done(ExtensionsManager)
.
Note that the file is read-only to begin with. If the processor
wants to call any write-operation the file must be opened by
calling ExtensionsFile.WriteableExtensionsFile.open()
. It is recommended
that the processor calls ExtensionsFile.WriteableExtensionsFile.close()
once it is done writing.
processFile
in interface ExtensionsFileProcessor
manager
- The manager that is executing the actionwFile
- The file to be processedpublic void done(ExtensionsManager manager)
ExtensionsFileProcessor
done
in interface ExtensionsFileProcessor
manager
- The manager that is executing the actionpublic void done(ExtensionsManager manager, java.lang.Throwable t)
ExtensionsFileProcessor
done
in interface ExtensionsFileProcessor
manager
- The manager that is executing the actiont
- The exceptionpublic void setDelayRegistration(boolean delayRegistration)
done(ExtensionsManager)
method is
called by the manager. If this flag is set the
finalizeRegistration(ExtensionsManager)
method must be explicitely called.public boolean isRegistrationDelayed()
public int getNumFiles()
public void finalizeRegistration(ExtensionsManager manager)