/** deprecated call {@link SubTask#getOwnerTask} directly */ @Deprecated public static @Nonnull Task getOwnerTaskOf(@Nonnull SubTask t) { return t.getOwnerTask(); }
/** * Checks if the current user has a permission to stop this build. */ public boolean hasStopPermission() { lock.readLock().lock(); try { return executable != null && getParentOf(executable).getOwnerTask().hasAbortPermission(); } finally { lock.readLock().unlock(); } }
/** * Gets the {@link hudson.model.Item} most closely associated with the supplied {@link SubTask}. * @param t the {@link SubTask}. * @return the {@link hudson.model.Item} associated with the {@link SubTask} or {@code null} if this * {@link SubTask} is not associated with an {@link hudson.model.Item} * @since 2.55 */ @CheckForNull public static hudson.model.Item getItemOf(@Nonnull SubTask t) { Queue.Task p = t.getOwnerTask(); while (!(p instanceof hudson.model.Item)) { Queue.Task o = p.getOwnerTask(); if (o == p) { break; } p = o; } return p instanceof hudson.model.Item ? (hudson.model.Item)p : null; }
/** * Stops the current build. * * @since 1.489 */ @RequirePOST public HttpResponse doStop() { lock.writeLock().lock(); // need write lock as interrupt will change the field try { if (executable != null) { getParentOf(executable).getOwnerTask().checkAbortPermission(); interrupt(); } } finally { lock.writeLock().unlock(); } return HttpResponses.forwardToPreviousPage(); }
/** * A pointless function to work around what appears to be a HotSpot problem. * See HUDSON-5756 and bug 6933067 on BugParade for more details. */ public static Task _getOwnerTaskOf(SubTask t) { return t.getOwnerTask(); }
/** * A pointless function to work around what appears to be a HotSpot problem. See HUDSON-5756 and bug 6933067 * on BugParade for more details. */ public static Task _getOwnerTaskOf(SubTask t) { return t.getOwnerTask(); }
/** * A pointless function to work around what appears to be a HotSpot problem. See HUDSON-5756 and bug 6933067 * on BugParade for more details. */ public static Task _getOwnerTaskOf(SubTask t) { return t.getOwnerTask(); }
/** * A pointless function to work around what appears to be a HotSpot problem. See HUDSON-5756 and bug 6933067 * on BugParade for more details. */ public static Task _getOwnerTaskOf(SubTask t) { return t.getOwnerTask(); }
/** deprecated call {@link SubTask#getOwnerTask} directly */ @Deprecated public static @Nonnull Task getOwnerTaskOf(@Nonnull SubTask t) { return t.getOwnerTask(); }
/** * Checks if the current user has a permission to stop this build. */ public boolean hasStopPermission() { lock.readLock().lock(); try { return executable != null && getParentOf(executable).getOwnerTask().hasAbortPermission(); } finally { lock.readLock().unlock(); } }
/** * Gets the {@link hudson.model.Item} most closely associated with the supplied {@link SubTask}. * @param t the {@link SubTask}. * @return the {@link hudson.model.Item} associated with the {@link SubTask} or {@code null} if this * {@link SubTask} is not associated with an {@link hudson.model.Item} * @since 2.55 */ @CheckForNull public static hudson.model.Item getItemOf(@Nonnull SubTask t) { Queue.Task p = t.getOwnerTask(); while (!(p instanceof hudson.model.Item)) { Queue.Task o = p.getOwnerTask(); if (o == p) { break; } p = o; } return p instanceof hudson.model.Item ? (hudson.model.Item)p : null; }
/** * Gets the {@link hudson.model.Item} most closely associated with the supplied {@link SubTask}. * * @param t the {@link SubTask}. * @return the {@link hudson.model.Item} associated with the {@link SubTask} or {@code null} if this * {@link SubTask} is not associated with an {@link hudson.model.Item} * @since TODO */ @CheckForNull public static hudson.model.Item getItemOf(@Nonnull SubTask t) { // TODO move to default method on SubTask once code level is Java 8 Queue.Task p = t.getOwnerTask(); while (!(p instanceof hudson.model.Item)) { Queue.Task o = p.getOwnerTask(); if (o == p) { break; } p = o; } return p instanceof hudson.model.Item ? (hudson.model.Item) p : null; }
private ExecutorPickle(Executor executor) { if (executor instanceof OneOffExecutor) { throw new IllegalArgumentException("OneOffExecutor not currently supported"); } Queue.Executable exec = executor.getCurrentExecutable(); if (exec == null) { throw new IllegalArgumentException("cannot save an Executor that is not running anything"); } this.isEphemeral = executor.getOwner().getNode() instanceof EphemeralNode; SubTask parent = exec.getParent(); this.task = parent instanceof Queue.Task ? (Queue.Task) parent : parent.getOwnerTask(); if (task instanceof Queue.TransientTask) { throw new IllegalArgumentException("cannot save a TransientTask"); } LOGGER.log(Level.FINE, "saving {0}", task); }
/** * Stops the current build. * * @since 1.489 */ @RequirePOST public HttpResponse doStop() { lock.writeLock().lock(); // need write lock as interrupt will change the field try { if (executable != null) { getParentOf(executable).getOwnerTask().checkAbortPermission(); interrupt(); } } finally { lock.writeLock().unlock(); } return HttpResponses.forwardToPreviousPage(); }
final SubTask parentTask = currentExecutable != null ? currentExecutable.getParent() : null; if (currentExecutable != null && parentTask.getOwnerTask().getName().equals(item.task.getName())) { List<ParameterValue> executingUnitParams = getParametersFromWorkUnit(exec.getCurrentWorkUnit()); executingUnitParams = doFilterParams(paramsToCompare, executingUnitParams);