protected static class MigrationServiceImpl.MigrationContextImpl extends Object implements MigrationService.MigrationContext
Modifier and Type | Field and Description |
---|---|
protected MigrationServiceImpl.ProgressReporter |
progressReporter |
protected boolean |
shutdown |
Constructor and Description |
---|
MigrationContextImpl(MigrationServiceImpl.ProgressReporter progressReporter) |
Modifier and Type | Method and Description |
---|---|
boolean |
isShutdownRequested()
Checks if shutdown has been requested.
|
void |
reportProgress(String message,
long num,
long total)
Notifies the migration context of the current progress.
|
void |
requestShutdown()
Requests a shutdown.
|
protected final MigrationServiceImpl.ProgressReporter progressReporter
protected volatile boolean shutdown
public MigrationContextImpl(MigrationServiceImpl.ProgressReporter progressReporter)
public void reportProgress(String message, long num, long total)
MigrationService.MigrationContext
reportProgress
in interface MigrationService.MigrationContext
message
- an informative message about what is being migratednum
- the current number of things migratedtotal
- the total number of things to migrate, or -1
if unknownpublic void requestShutdown()
MigrationService.MigrationContext
requestShutdown
in interface MigrationService.MigrationContext
public boolean isShutdownRequested()
MigrationService.MigrationContext
This should be checked periodically by the migrator, and when true
the migrator should return as soon
as possible, even if its work is not complete.
This is a "nice" version of thread interruption, which will follow a short while later, and should also be checked by the migrator.
isShutdownRequested
in interface MigrationService.MigrationContext
true
if migration should be stopped as soon as possibleCopyright © 2018 Nuxeo. All rights reserved.