Ends the specified activity

@param activity
425348
public void endActivity(HttpClientNIORequestActivityImpl activity) {

        final HttpClientNIORequestActivityHandle ah = new HttpClientNIORequestActivityHandle(activity.getId());

        if (activities.containsKey(ah)) {
            resourceAdaptorContext.getSleeEndpoint().endActivity(ah);
        }
    }
815485
@Override
	public void onActivityStopped(final Activity activity) {
		if (foregroundActivities.decrementAndGet() < 0) {
			ApptentiveLog.e("Incorrect number of foreground Activities encountered. Resetting to 0.");
			foregroundActivities.set(0);
		}

		if (checkFgBgRoutine != null) {
			delayedChecker.removeCallbacks(checkFgBgRoutine);
		}

		/* When one activity transits to another one, there is a brief period during which the former
		 * is paused but the latter has not yet resumed. To prevent false negative, check routine is
		 * delayed
		 */
		delayedChecker.postDelayed(checkFgBgRoutine = new Runnable() {
			@Override
			public void run() {
				try {
					if (foregroundActivities.get() == 0 && isAppForeground) {
						appEnteredBackground();
						isAppForeground = false;
					}
				} catch (Exception e) {
					ApptentiveLog.e(e, "Exception in delayed checking");
					ErrorMetrics.logException(e);
				}
			}
		}, CHECK_DELAY_SHORT);

		dispatchOnConversationQueue(new DispatchTask() {
			@Override
			protected void execute() {
				ApptentiveNotificationCenter.defaultCenter()
						.postNotification(NOTIFICATION_ACTIVITY_STOPPED, NOTIFICATION_KEY_ACTIVITY, activity);
			}
		});
	}
655972
public function removePrimaryResource(Activity $activity)
    {
        $activity->setPrimaryResource();
        $this->om->persist($activity);
        $this->om->flush();
    }
165668
public void sbbRemove() {
		// terminate the xcap activity, if exists
		ActivityContextInterface[] activities = sbbContext.getActivities();
		if (activities.length != 0) {
			activities[0].detach(sbbContext.getSbbLocalObject());
			((AsyncActivity) activities[0].getActivity()).endActivity();
		}
	}
436513
public void endsWith(String string) {
    checkNotNull(string);
    if (actual() == null) {
      failWithActual("expected a string that ends with", string);
    } else if (!actual().endsWith(string)) {
      failWithActual("expected to end with", string);
    }
  }
1356228
public void sessionEnd(SessionStatus finishState) {
    if (sessionStatusToMetrics.containsKey(finishState)) {
      sessionStatusToMetrics.get(finishState).inc();
    } else {
      throw new IllegalArgumentException("Invalid end state " + finishState);
    }
  }
623561
void clearCroutonsForActivity(Activity activity) {
    Iterator<Crouton> croutonIterator = croutonQueue.iterator();
    while (croutonIterator.hasNext()) {
      Crouton crouton = croutonIterator.next();
      if ((null != crouton.getActivity()) && crouton.getActivity().equals(activity)) {
        // remove the crouton from the content view
        removeCroutonFromViewParent(crouton);

        removeAllMessagesForCrouton(crouton);

        // remove the crouton from the queue
        croutonIterator.remove();
      }
    }
  }
982108
public static void remove(@NonNull Activity activity, @NonNull String viewId) {
    if (activity == null) {
      throw new NullPointerException("Activity is null");
    }

    ActivityScopedCache activityScope = getActivityScope(activity);
    if (activityScope != null) {
      activityScope.remove(viewId);
    }
  }
119080
public void close() throws IOException {
        if (!closed) {
            finish();
            if (usesDefaultDeflater)
                def.end();
            out.close();
            closed = true;
        }
    }
881385
public void activityEnded(ActivityHandle ah) {		
		if (tracer.isFineEnabled()) {
			tracer.fine("activityEnded( handle = "+ah+")");
		}
		// just remove the handle
	    activities.remove(ah);
	}
611471
public static void end(Progression model) {
		if (model != null) {
			model.end();
			model.setComment(null);
		}
	}
553552
public void exit() {
        if (currentView == null) {
            GdxUtilities.exit();
        } else {
            currentView.getStage().addAction(Actions.sequence(getViewHidingAction(currentView),
                    Actions.run(GdxUtilities.getApplicationClosingRunnable())));
        }
    }
739394
@AnyThread
    protected void safeEndSession ()
    {
        if (!_omgr.isRunning()) {
            log.info("Dropping end session request as we're shutting down " + this + ".");
        } else {
            _omgr.postRunnable(new Runnable() {
                public void run () {
                    endSession();
                }
            });
        }
    }
450074
protected void endNode(int node) throws org.xml.sax.SAXException
  {
    super.endNode(node);
    if(DTM.ELEMENT_NODE == m_dtm.getNodeType(node))
    {
      m_transformer.getXPathContext().popCurrentNode();
    }
  }
931902
@Override
    public void endLink(ResourceReference reference, boolean freestanding, Map<String, String> parameters)
    {
        saveEvent(EventType.END_LINK, reference, freestanding, parameters);
    }
671233
private static void finalClose(final Closeable closeMe) {
        if (closeMe != null) {
            try {
                closeMe.close();
            } catch (IOException iox) {
                LOG.log(Level.FINEST, "Could not close: " + closeMe, iox);
            }
        }
    }
426837
public final void end() {
    final Thread thread = threadRef;
    if (thread != null) {
      thread.interrupt();
      try {
        thread.join();
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
      }
    }
    this.threadRef = null;
  }