@Override public void onResume() { super.onResume(); }
@Override public void stop(Throwable cause) throws Exception { if (task != null) { task.cancel(false); } super.stop(cause); }
@Deprecated protected void inject() { try { AbstractStepImpl.prepareInjector(getContext(), null).injectMembers(this); } catch (Exception e) { getContext().onFailure(e); } } }
/** * Reinject {@link StepContextParameter}s. * The {@link Step} will not be reinjected. */ // Cannot mark this @Deprecated without producing a warning for overriders. @Override public void onResume() { inject(); }
/** * Reinject {@link StepContextParameter}s. * The {@link Step} will not be reinjected. */ // Cannot mark this @Deprecated without producing a warning for overriders. @Override public void onResume() { inject(); }
@Override public void onResume() { super.onResume(); try { purgeSockets(); initRemoteAgent(); } catch (IOException io) { listener.getLogger().println(Messages.SSHAgentBuildWrapper_CouldNotStartAgent()); } }
@Override public void stop(Throwable cause) throws Exception { if (task != null) { task.cancel(false); } super.stop(cause); }
@Deprecated protected void inject() { try { AbstractStepImpl.prepareInjector(getContext(), null).injectMembers(this); } catch (Exception e) { getContext().onFailure(e); } } }
/** * Re-inject the dynamic template when resuming the pipeline */ @Override public void onResume() { super.onResume(); Cloud cloud = Jenkins.getInstance().getCloud(cloudName); if (cloud == null) { throw new RuntimeException(String.format("Cloud does not exist: %s", cloudName)); } if (!(cloud instanceof KubernetesCloud)) { throw new RuntimeException(String.format("Cloud is not a Kubernetes cloud: %s (%s)", cloudName, cloud.getClass().getName())); } KubernetesCloud kubernetesCloud = (KubernetesCloud) cloud; kubernetesCloud.addDynamicTemplate(newTemplate); }
@Override public void stop(final Throwable cause) throws Exception { FilePath workspace = getWorkspace(); if (workspace != null) { logger().println("Sending interrupt signal to process"); LOGGER.log(Level.FINE, "stopping process", cause); stopTask = Timer.get().schedule(new Runnable() { @Override public void run() { stopTask = null; if (recurrencePeriod > 0) { recurrencePeriod = 0; logger().println("After 10s process did not stop"); getContext().onFailure(cause); } } }, 10, TimeUnit.SECONDS); controller.stop(workspace, launcher()); } else { logger().println("Could not connect to " + node + " to send interrupt signal to process"); recurrencePeriod = 0; super.stop(cause); } }
@Override public void onResume() { super.onResume(); try { listener.getLogger().println("again running as " + flow.getAuthentication().getName() + " from " + Thread.currentThread().getName()); } catch (Exception x) { getContext().onFailure(x); } } }
@Override public void stop(Throwable cause) throws Exception { for (Queue.Item item : Queue.getInstance().getItems()) { // if we are still in the queue waiting to be scheduled, just retract that if (item.task instanceof PlaceholderTask && ((PlaceholderTask) item.task).context.equals(getContext())) { Queue.getInstance().cancel(item); break; } } Jenkins j = Jenkins.getInstance(); if (j != null) { // if we are already running, kill the ongoing activities, which releases PlaceholderExecutable from its sleep loop // Similar to Executor.of, but distinct since we do not have the Executable yet: COMPUTERS: for (Computer c : j.getComputers()) { for (Executor e : c.getExecutors()) { Queue.Executable exec = e.getCurrentExecutable(); if (exec instanceof PlaceholderTask.PlaceholderExecutable && ((PlaceholderTask.PlaceholderExecutable) exec).getParent().context.equals(getContext())) { PlaceholderTask.finish(((PlaceholderTask.PlaceholderExecutable) exec).getParent().cookie); break COMPUTERS; } } } } // Whether or not either of the above worked (and they would not if for example our item were canceled), make sure we die. super.stop(cause); }
@Override public void onResume() { super.onResume();
@Override public void onResume() { super.onResume();
@Override public void onResume() { super.onResume();