|
3.0.1: 2011-11-10 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExtensionsFileProcessor
Interface that is used to request a callback for each extensions file managed by an extensions manager. Implementations are more or less free to do whatever they want with the file. Typically, they will scan the XML metadata or the contents of a JAR file and do something with it.
A processer implementation is used by calling ExtensionsManager.processFiles(ExtensionsFileProcessor)
.
The manager will first call begin(ExtensionsManager, int)
and
then processFile(ExtensionsManager, ExtensionsFile.WriteableExtensionsFile)
for each
file that has been confirmed to contain a valid extension definitions
file. If all files could be processed without problems the manager
finishes by calling done(ExtensionsManager)
. If the processor
throws an exception the processing is immediately aborted and
done(ExtensionsManager, Throwable)
is called instead.
Method Summary | |
---|---|
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,
Throwable t)
Called by the extensions manager if an exception was thrown by the processor. |
void |
processFile(ExtensionsManager manager,
ExtensionsFile.WriteableExtensionsFile file)
Called by the extensions manager for each extensions file that it manages. |
Method Detail |
---|
void begin(ExtensionsManager manager, int numFiles)
manager
- The manager that is executing the actionnumFiles
- The number of extension files that is going to be processed this timevoid processFile(ExtensionsManager manager, ExtensionsFile.WriteableExtensionsFile file)
If the processor throws an exception the manager will abort
processing and call 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 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.
manager
- The manager that is executing the actionfile
- The file to be processedvoid done(ExtensionsManager manager)
manager
- The manager that is executing the actionvoid done(ExtensionsManager manager, Throwable t)
manager
- The manager that is executing the actiont
- The exception
|
3.0.1: 2011-11-10 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |