public class Finaliser extends java.lang.Object implements ImportFinaliser
ImportRunner
or the
ImportFailureHandler
have finished their work.
These include notifying the user of the import outcome and cleaning up
allocated resources, e.g. OMERO sessions, scheduling deletion of import
logs, etc.Constructor and Description |
---|
Finaliser(ImportEnv env)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
RepeatAction |
consume(ProcessedImport task)
Processes messages from the GC queue to carry out each step in the batch
finalisation procedure.
|
protected ImportFinaliser |
handlerFor(ImportFinalisationPhase status) |
void |
onBatchCompletion(ProcessedImport task)
Triggers the procedure to finalise the import batch after all import
tasks within it have run.
|
void |
onFailure(QueuedImport task)
Triggers the completion of an import task when the OMERO import has
failed.
|
void |
onSuccess(QueuedImport task)
Triggers the completion of an import task when the OMERO import has run
successfully.
|
public Finaliser(ImportEnv env)
env
- the import environment.java.lang.NullPointerException
- if the argument is null
.public void onSuccess(QueuedImport task)
task
- the import task.java.lang.NullPointerException
- if the argument is null
.public void onFailure(QueuedImport task)
task
- the import task.java.lang.NullPointerException
- if the argument is null
.public void onBatchCompletion(ProcessedImport task)
task
- the last import task that was processed and completed the
batch.java.lang.NullPointerException
- if the argument is null
.public RepeatAction consume(ProcessedImport task)
consume
in interface RepeatConsumer<ProcessedImport>
task
- which step to carry out.Repeat
if the current step of the
finalisation procedure failed because of a transient error condition and
it should be retried or Stop
if it should not
be retried either because it succeeded or because it failed but it's not
possible to recover.protected ImportFinaliser handlerFor(ImportFinalisationPhase status)