public abstract class AbstractPackageOperation extends java.lang.Object implements PackageOperation
Installers and Uninstallers that manages creation of temp
directories, writing package metadata and install status, and resuming in-progress installs.| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractPackageOperation.AbstractInstaller
Framework for an installer that creates a temporary directory, writes package.xml when it's
done, and can resume if partly done.
|
static class |
AbstractPackageOperation.AbstractUninstaller
Framework for a basic uninstaller that keeps track of its status and invalidates the list of
installed packages when complete.
|
PackageOperation.InstallStatus, PackageOperation.StatusChangeListener, PackageOperation.StatusChangeListenerException| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPackageOperation(RepoManager repoManager,
FileOp fop) |
| Modifier and Type | Method and Description |
|---|---|
PackageOperation.InstallStatus |
getInstallStatus()
Gets the current
PackageOperation.InstallStatus of this installer. |
RepoManager |
getRepoManager()
Gets the
RepoManager for which we're installing/uninstalling a package. |
void |
registerStateChangeListener(PackageOperation.StatusChangeListener listener)
Registers a listener that will be called when the
PackageOperation.InstallStatus of
this installer changes. |
protected boolean |
updateStatus(PackageOperation.InstallStatus status,
ProgressIndicator progress)
Sets our status to
status and notifies our listeners. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomplete, getLocation, getPackage, prepareprotected final FileOp mFop
protected AbstractPackageOperation(@NonNull
RepoManager repoManager,
@NonNull
FileOp fop)
@NonNull public RepoManager getRepoManager()
PackageOperationRepoManager for which we're installing/uninstalling a package.getRepoManager in interface PackageOperationpublic final void registerStateChangeListener(@NonNull
PackageOperation.StatusChangeListener listener)
PackageOperation.InstallStatus of
this installer changes.registerStateChangeListener in interface PackageOperation@NonNull public final PackageOperation.InstallStatus getInstallStatus()
PackageOperation.InstallStatus of this installer.getInstallStatus in interface PackageOperationprotected final boolean updateStatus(@NonNull
PackageOperation.InstallStatus status,
@NonNull
ProgressIndicator progress)
status and notifies our listeners. If any listener throws an
exception we will stop processing listeners and update our status to InstallStatus.FAILED (calling the listeners again with that status update).