@Override public void testFailure(Failure failure) throws Exception { failures.add(failure); }
@Override public void registerCancelListener( CancelListener listener ) { cancelListeners.add( listener ); } }
/** * Add a view to this table. * * @param view the view to add */ public void addDependentView(TableView view) { dependentViews.add(view); }
/** * * @param ordinal * Crude ordering control among {@link FilePathFilter} ala {@link Extension#ordinal()}. * A filter with a bigger value will get precedence. Defaults to 0. */ public void add(FilePathFilter f, double ordinal) { Entry e = new Entry(f, ordinal); int i = Collections.binarySearch(all, e, Collections.reverseOrder()); if (i>=0) all.add(i,e); else all.add(-i-1,e); }
@Override public void stop() { if (this.stoppedBeans != null) { this.stoppedBeans.add(this); } this.running = false; } }
@Override public void start() { if (this.startedBeans != null) { this.startedBeans.add(this); } this.running = true; }
@VisibleForTesting public void moveTaskGroupToPendingCompletion(int taskGroupId) { final TaskGroup taskGroup = activelyReadingTaskGroups.remove(taskGroupId); if (taskGroup != null) { pendingCompletionTaskGroups.computeIfAbsent(taskGroupId, k -> new CopyOnWriteArrayList<>()).add(taskGroup); } }
public void addListener(MockTimeListener listener) { listeners.add(listener); }
@Override public void onLoadCompleted( int windowIndex, @Nullable MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) { Assertions.checkState(Looper.myLooper() == playbackThread.getLooper()); completedLoads.add(Pair.create(windowIndex, mediaPeriodId)); }
/** * Starts executing a fly-weight task. */ /*package*/ final void startFlyWeightTask(WorkUnit p) { OneOffExecutor e = new OneOffExecutor(this); e.start(p); oneOffExecutors.add(e); }
private synchronized boolean addSync(T t) { legacyInstances.add(new ExtensionComponent<T>(t)); // if we've already filled extensions, add it if(extensions!=null) { List<ExtensionComponent<T>> r = new ArrayList<ExtensionComponent<T>>(extensions); r.add(new ExtensionComponent<T>(t)); extensions = sort(r); } return true; }
@Implementation protected void registerContentObserver( Uri uri, boolean notifyForDescendents, ContentObserver observer) { if (uri == null || observer == null) { throw new NullPointerException(); } contentObservers.add(new ContentObserverEntry(uri, notifyForDescendents, observer)); }
/** * Add a default resource. Resources are loaded in the order of the resources * added. * @param name file name. File should be present in the classpath. */ public static synchronized void addDefaultResource(String name) { if(!defaultResources.contains(name)) { defaultResources.add(name); for(Configuration conf : REGISTRY.keySet()) { if(conf.loadDefaults) { conf.reloadConfiguration(); } } } }
private void addNewExecutorIfNecessary() { if (Jenkins.getInstanceOrNull() == null) { return; } Set<Integer> availableNumbers = new HashSet<Integer>(); for (int i = 0; i < numExecutors; i++) availableNumbers.add(i); for (Executor executor : executors) availableNumbers.remove(executor.getNumber()); for (Integer number : availableNumbers) { /* There may be busy executors with higher index, so only fill up until numExecutors is reached. Extra executors will call removeExecutor(...) and that will create any necessary executors from #0 again. */ if (executors.size() < numExecutors) { Executor e = new Executor(this, number); executors.add(e); } } }
/** * Adds a listener to the event dispatcher. * * @param handler A handler on the which listener events will be posted. * @param eventListener The listener to be added. */ public void addEventListener(Handler handler, MediaSourceEventListener eventListener) { Assertions.checkArgument(handler != null && eventListener != null); listenerAndHandlers.add(new ListenerAndHandler(handler, eventListener)); }
/** Adds a listener to the event dispatcher. */ public void addListener(Handler handler, T eventListener) { Assertions.checkArgument(handler != null && eventListener != null); removeListener(eventListener); listeners.add(new HandlerAndListener<>(handler, eventListener)); }
@RequirePOST public void doCreateView( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(View.CREATE); views.add(View.create(req,rsp,this)); save(); }
@Override public void onLoadCompleted( int windowIndex, @Nullable MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) { Assertions.checkState(Looper.myLooper() == playbackThread.getLooper()); completedLoads.add(Pair.create(windowIndex, mediaPeriodId)); }
@SuppressWarnings("unused") @Implementation public void addOnPreDrawListener(OnPreDrawListener listener) { checkIsAlive(); preDrawListeners.add(listener); }
private static void pipe( final String prefix, final InputStream source, final PrintStream target ) { synchronized ( PipeThread.class ) { if ( piper == null ) { piper = new PipeThread(); piper.start(); } piper.tasks.add( new PipeTask( prefix, source, target ) ); } }