AsynchronousInstallStatus asynchStatus = contextsInstalledByExecutor.checkInstalled(ctx);
contextsInstalledByExecutor.disassociateWithTask(context);
boolean asynch = contextsInstalledByExecutor.shouldInstallAsynchronously(context); contextsInstalledByExecutor.markForTaskExecution(context, task); contextsInstalledByExecutor.disassociateWithTask(context);
if (!selfDependency) contextsInstalledByExecutor.interruptTaskAndBlock(dependent, this); if (stateModel.isBeforeState(dependent.getState(), whenRequired) == false)
/** * Associate the current thread with the task, or clear it in contextsInstalledByExecutor * if it has been interrupted. This should be the first thing tasks do once they run. * * @param context the context * @return true if interrupted */ synchronized boolean associateWithThreadOrDisassociateIfInterrupted(ControllerContext context) { if (interrupted) { contextsInstalledByExecutor.disassociateWithTask(context); return true; } thread = Thread.currentThread(); return false; }
/** * Obtains the context, having interrupted its installation process if it is an asynchronous context * currently being installed * @param name The name of the context * @return the context or null if not found */ private ControllerContext getRegisteredContextAndInterruptAsynchronousInstall(Object name) { ControllerContext context = getRegisteredControllerContext(name, false); if (context != null) { contextsInstalledByExecutor.interruptTaskAndBlock(context, this); context = getRegisteredControllerContext(name, false); } return context; }
public boolean isAsynchronousInstallInProgress(ControllerContext context) { if (context.getMode() != ControllerMode.ASYNCHRONOUS) return false; return contextsInstalledByExecutor.checkInstalled(context) != AsynchronousInstallStatus.NOT_INSTALLING; }