/** * Returns the snapshot view of instances as list. */ public List<T> toList() { return data.getView(); }
/** * List of all {@link JobProperty} exposed primarily for the remoting API. * @since 1.282 */ @Exported(name="property",inline=true) public List<JobProperty<? super JobT>> getAllProperties() { return properties.getView(); }
/** * A convenience method to replace a single item. * * This method shouldn't be used when you are replacing a lot of stuff * as copy-on-write semantics make this rather slow. */ public void replace(T from, T to) throws IOException { List<T> copy = new ArrayList<T>(data.getView()); for (int i=0; i<copy.size(); i++) { if (copy.get(i).equals(from)) copy.set(i,to); } data.replaceBy(copy); }
/** * Returns the snapshot view of instances as list. */ public List<T> toList() { return data.getView(); }
/** * Returns the snapshot view of instances as list. */ public List<T> toList() { return data.getView(); }
/** * Returns the snapshot view of instances as list. */ public List<T> toList() { return data.getView(); }
/** * Returns the snapshot view of instances as list. */ public List<T> toList() { return data.getView(); }
/** * Standard constructor. Used for legacy conversion. * * @param legacyCauses the causes. */ public LocalFileKnowledgeBase(CopyOnWriteList<FailureCause> legacyCauses) { this(legacyCauses.getView()); }
/** * Returns the snapshot view of instances as list. */ public List<T> toList() { return data.getView(); }
/** * List of all {@link JobProperty} exposed primarily for the remoting API. * @since 1.282 */ @Exported(name="property",inline=true) public List<JobProperty<? super JobT>> getAllProperties() { return properties.getView(); }
@Override public Collection<GlobalVariable> forRun(Run<?, ?> run) { if (ours==null) { rebuild(); } return ours.getView(); } }
/** * Gets the read-only view of all the promotions that this build achieved. */ @Exported public List<Status> getPromotions() { return statuses.getView(); }
/** * A convenience method to replace a single item. * * This method shouldn't be used when you are replacing a lot of stuff * as copy-on-write semantics make this rather slow. */ public void replace(T from, T to) throws IOException { List<T> copy = new ArrayList<T>(data.getView()); for (int i=0; i<copy.size(); i++) { if (copy.get(i).equals(from)) copy.set(i,to); } data.replaceBy(copy); }
public synchronized void unregister(final FlowExecutionOwner self) { if (runningTasks.remove(self)) { LOGGER.log(FINE, "unregistered {0}", new Object[] {self}); saveLater(); } else { LOGGER.log(WARNING, "{0} was not in the list to begin with: {1}", new Object[] {self, runningTasks.getView()}); } }
private synchronized void saveLater() { final List<FlowExecutionOwner> copy = new ArrayList<>(runningTasks.getView()); LOGGER.log(FINE, "scheduling save of {0}", copy); try { executor.submit(new Runnable() { @Override public void run() { save(copy); } }); } catch (RejectedExecutionException x) { LOGGER.log(FINE, "could not schedule save, perhaps because Jenkins is shutting down; saving immediately", x); save(copy); } } private void save(List<FlowExecutionOwner> copy) {
/** * List of all {@link JobProperty} exposed primarily for the remoting API. * List contains cascadable {@link JobProperty} if any. * @since 2.2.0 */ @Exported(name = "property", inline = true) @SuppressWarnings("unchecked") public List<JobProperty<? super JobT>> getAllProperties() { CopyOnWriteList cascadingJobProperties = getCascadingJobProperties(); List<JobProperty<? super JobT>> result = properties.getView(); if (null != cascadingJobProperties && !cascadingJobProperties.isEmpty()) { result = Collections.unmodifiableList(ListUtils.union(result, cascadingJobProperties.getView())); } return result; }
/** * List of all {@link JobProperty} exposed primarily for the remoting API. * List contains cascadable {@link JobProperty} if any. * @since 2.2.0 */ @Exported(name = "property", inline = true) public List<JobProperty<? super JobT>> getAllProperties() { CopyOnWriteList cascadingJobProperties = getCascadingJobProperties(); List<JobProperty<? super JobT>> result = properties.getView(); if (null != cascadingJobProperties && !cascadingJobProperties.isEmpty()) { result = Collections.unmodifiableList(ListUtils.union(result, cascadingJobProperties.getView())); } return result; }
/** * List of all {@link JobProperty} exposed primarily for the remoting API. * List contains cascadable {@link JobProperty} if any. * @since 2.2.0 */ @Exported(name = "property", inline = true) public List<JobProperty<? super JobT>> getAllProperties() { CopyOnWriteList cascadingJobProperties = getCascadingJobProperties(); List<JobProperty<? super JobT>> result = properties.getView(); if (null != cascadingJobProperties && !cascadingJobProperties.isEmpty()) { result = Collections.unmodifiableList(ListUtils.union(result, cascadingJobProperties.getView())); } return result; }
/** * List of all {@link JobProperty} exposed primarily for the remoting API. * List contains cascadable {@link JobProperty} if any. * * @since 2.2.0 */ @Exported(name = "property", inline = true) @SuppressWarnings("unchecked") public List<JobProperty<? super JobT>> getAllProperties() { CopyOnWriteList cascadingJobProperties = getCascadingJobProperties(); List<JobProperty<? super JobT>> result = properties.getView(); if (null != cascadingJobProperties && !cascadingJobProperties.isEmpty()) { result = Collections.unmodifiableList(ListUtils.union(result, cascadingJobProperties.getView())); } return result; }
/** * It is the responsibility of the {@link FlowExecutionOwner} to register itself before it starts executing. * And likewise, unregister itself after it is completed, even though this class does clean up entries that * are no longer running. */ public synchronized void register(final FlowExecutionOwner self) { if (runningTasks.contains(self)) { LOGGER.log(WARNING, "{0} was already in the list: {1}", new Object[] {self, runningTasks.getView()}); } else { runningTasks.add(self); saveLater(); } }