Asynchronously fulfills the request into the specified {@link RemoteViews} object with the
given {@code viewId}. This is used for loading bitmaps into a {@link Notification}.
775497
public void into(@NonNull RemoteViews remoteViews, @IdRes int viewId, int notificationId,
      @NonNull Notification notification, @Nullable String notificationTag,
      @Nullable Callback callback) {
    long started = System.nanoTime();

    if (remoteViews == null) {
      throw new IllegalArgumentException("RemoteViews must not be null.");
    }
    if (notification == null) {
      throw new IllegalArgumentException("Notification must not be null.");
    }
    if (deferred) {
      throw new IllegalStateException("Fit cannot be used with RemoteViews.");
    }
    if (placeholderDrawable != null || errorDrawable != null) {
      throw new IllegalArgumentException(
          "Cannot use placeholder or error drawables with remote views.");
    }

    Request request = createRequest(started);
    RemoteViewsAction action =
        new NotificationAction(picasso, request, errorResId,
            new RemoteViewsTarget(remoteViews, viewId), notificationId, notification,
            notificationTag, callback);

    performRemoteViewInto(request, action);
  }
1211834
public RequestDispatcher createRequestDispatcher(RequestImpl request, Klass<?> type, Object it, String viewName) throws IOException {
        return null;    // should be really abstract, but not
    }
1323765
public RequestViewMetadata cloneInstance()
    {
        RequestViewMetadata rvm = new RequestViewMetadata();
        rvm.initialProcessedClasses = new HashMap<Class<?>, Boolean>(
                this.initialProcessedClasses != null ? 
                    this.initialProcessedClasses : this.processedClasses);
        if (this.initialAddedResources != null)
        {
            rvm.initialAddedResources = new HashMap<ResourceDependency, Boolean>(
                    this.initialAddedResources);
        }
        else if (this.addedResources != null)
        {
            rvm.initialAddedResources = new HashMap<ResourceDependency, Boolean>(
                    this.addedResources);
        }
        return rvm;
    }
394302
@Override
    public void bindView(ViewHolder viewHolder, List<Object> payloads) {
        super.bindView(viewHolder, payloads);

        //define our data for the view
        viewHolder.image.setIcon(new IconicsDrawable(viewHolder.image.getContext(), getModel().icon));
        viewHolder.name.setText(getModel().icon.getName());
    }
966912
public synchronized void submitOperation(int requestId, AsyncOperation operation) {
        if(this.operations.containsKey(requestId))
            throw new VoldemortException("Request " + requestId
                                         + " already submitted to the system");

        this.operations.put(requestId, operation);
        scheduler.scheduleNow(operation);
        logger.debug("Handling async operation " + requestId);
    }
1178451
protected void open(int remoteid, long remotewindow, int remotepacket)
			throws IOException {
		this.remoteid = remoteid;
		this.remotewindow = new DataWindow(remotewindow, remotepacket);

		this.state = CHANNEL_OPEN;

		synchronized (listeners) {
			for (Enumeration<ChannelEventListener> e = listeners.elements(); e
					.hasMoreElements();) {
				(e.nextElement()).channelOpened(this);
			}
		}
	}
188120
public View waitForView(int id, int index, int timeout, boolean scroll){
		Set<View> uniqueViewsMatchingId = new HashSet<View>();
		long endTime = SystemClock.uptimeMillis() + timeout;

		while (SystemClock.uptimeMillis() <= endTime) {
			sleeper.sleep();

			for (View view : viewFetcher.getAllViews(false)) {
				Integer idOfView = Integer.valueOf(view.getId());

				if (idOfView.equals(id)) {
					uniqueViewsMatchingId.add(view);

					if(uniqueViewsMatchingId.size() > index) {
						return view;
					}
				}
			}
			if(scroll) 
				scroller.scrollDown();
		}
		return null;
	}
446292
public ImageHelper load(ImageView v, ProgressBar progress, Request request) {
        RequestProgressListener listener = new RequestProgressListener(progress);
        if (loadInternal(v, request, listener, listener) == null) {
            listener.showProgress(v);
        } else {
            listener.showImage(v);
        }

        return this;
    }
357849
public void connectViewToCamera( int viewIndex , int cameraIndex ) {
		if( views[viewIndex].camera != -1 )
			throw new RuntimeException("View has already been assigned a camera");
		views[viewIndex].camera = cameraIndex;
	}
1279434
public String getDeployedViewURI(String controllerName, String viewName) {
        FastStringWriter buf = new FastStringWriter(PATH_TO_VIEWS);
        return getViewURIInternal(controllerName, viewName, buf, true);
    }
212588
public void registerView(@Nullable RegisterViewStatusListener callback) {
        if (Branch.getInstance() != null) {
            Branch.getInstance().registerView(this, callback);
        } else {
            if (callback != null) {
                callback.onRegisterViewFinished(false, new BranchError("Register view error", BranchError.ERR_BRANCH_NOT_INSTANTIATED));
            }
        }
    }
692716
@Override
    public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position, List<Object> payloads) {
        Object tag = viewHolder.itemView.getTag(R.id.fastadapter_item_adapter);
        if (tag instanceof FastAdapter) {
            FastAdapter fastAdapter = ((FastAdapter) tag);
            IItem item = fastAdapter.getItem(position);
            if (item != null) {
                item.bindView(viewHolder, payloads);
                if (viewHolder instanceof FastAdapter.ViewHolder) {
                    ((FastAdapter.ViewHolder) viewHolder).bindView(item, payloads);
                }
                //set the R.id.fastadapter_item tag of this item to the item object (can be used when retrieving the view)
                viewHolder.itemView.setTag(R.id.fastadapter_item, item);
            }
        }
    }
1035697
@Override
   public ManagerStatusResponse handleStatusRequest(int viewId) {
      try {
         // As long as we have an older view, we can still process topologies from the old coordinator
         waitForView(viewId, getGlobalTimeout(), TimeUnit.MILLISECONDS);
      } catch (InterruptedException e) {
         // Shutting down, send back an empty status
         Thread.currentThread().interrupt();
         return new ManagerStatusResponse(Collections.emptyMap(), true);
      }

      Map<String, CacheStatusResponse> caches = new HashMap<>();
      synchronized (runningCaches) {
         latestStatusResponseViewId = viewId;

         for (Map.Entry<String, LocalCacheStatus> e : runningCaches.entrySet()) {
            String cacheName = e.getKey();
            LocalCacheStatus cacheStatus = runningCaches.get(cacheName);
            caches.put(e.getKey(), new CacheStatusResponse(cacheStatus.getJoinInfo(),
                    cacheStatus.getCurrentTopology(), cacheStatus.getStableTopology(),
                    cacheStatus.getPartitionHandlingManager().getAvailabilityMode()));
         }
      }

      boolean rebalancingEnabled = true;
      // Avoid adding a direct dependency to the ClusterTopologyManager
      ReplicableCommand command = new CacheTopologyControlCommand(null,
            CacheTopologyControlCommand.Type.POLICY_GET_STATUS, transport.getAddress(),
            transport.getViewId());
      try {
         gcr.wireDependencies(command);
         SuccessfulResponse response = (SuccessfulResponse) command.invoke();
         rebalancingEnabled = (Boolean) response.getResponseValue();
      } catch (Throwable t) {
         log.warn("Failed to obtain the rebalancing status", t);
      }
      log.debugf("Sending cluster status response for view %d", viewId);
      return new ManagerStatusResponse(caches, rebalancingEnabled);
   }
406011
public static void synchronizeViewers(Collection<ImageViewer> viewers) {
		Iterator<ImageViewer> iterator = viewers.iterator();
		if (!iterator.hasNext()) return;
		
		Synchronizer mainSynchronizer=iterator.next().getSynchronizer();
		while (iterator.hasNext()) {
			mainSynchronizer.add(iterator.next());
		}
	}
905630
public static void putViewState(@NonNull Activity activity, @NonNull String viewId,
      @NonNull Object viewState) {
    if (activity == null) {
      throw new NullPointerException("Activity is null");
    }

    ActivityScopedCache scopedCache = getOrCreateActivityScopedCache(activity);
    scopedCache.putViewState(viewId, viewState);
  }
51017
public void into(@NonNull RemoteViews remoteViews, @IdRes int viewId,
      @NonNull int[] appWidgetIds) {
    into(remoteViews, viewId, appWidgetIds, null);
  }
71603
public RequestDispatcher createDispatcher(Object it, String viewName) throws IOException {
        Script script = findScript(viewName+getDefaultScriptExtension());
        if(script!=null)
            return new JellyRequestDispatcher(it,script);
        return null;
    }