/** * Free the {@code UnitAllocation}. * If the {@code UnitAllocation} was never allocated this method has no effect. * * @param unitAllocation * @throws CouldNotPerformException if the shutdown of the executableResource fails */ public static void deallocate(final UnitAllocation unitAllocation) throws CouldNotPerformException { try { unitAllocation.free(); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not deallocate resource", ex); } } }
@Override public Future<ActionFuture> execute() throws CouldNotPerformException { try { if (JPService.getProperty(JPResourceAllocation.class).getValue()) { return internalExecute().getTaskExecutor().getFuture(); } else { return internalExecuteWithoutResourceAllocation(); } } catch (JPNotAvailableException ex) { throw new CouldNotPerformException("Cold not execute action", ex); } }
return new UnitAllocation(new ExecutableResource(actionDescriptionBuilder.getResourceAllocation(), completionType) {
return unitAllocation.getTaskExecutor().getFuture();
unitAllocation.getTaskExecutor().getRemote().addSchedulerListener((allocation) -> { try { LOGGER.info("Update Allocation - Scope:[" + ScopeGenerator.generateStringRep(unit.getScope()) + "] State: [" + allocation.getState() + "]");