/* (non-Javadoc)
@see org.mobicents.diameter.simulator.clients.RoClient#stopAccounting(java.lang.String)
502918
public void stopCharging(String subscriptionId, String serviceContextId) throws Exception {
    // Stop existing timers
    sendUpdatetimer.cancel();
    callDurationTimer.cancel();

    try {
      // Call listener method
      this.listener.creditTerminated();
    }
    catch (Exception e) {
      logger.error("Failure in Listener handling 'creditTerminated' callback.");
    }

    if(logger.isInfoEnabled()) {
      logger.info("(((o))) SERVICE HAS BEEN TERMINATED! (((o)))");
    }

    // Fetch existing Ro session
    ClientCCASession roSession = roSessions.get(serviceContextId);

    // Create and Send CCR (TERMINATION)
    JCreditControlRequest terminateCCR = createCCR(CC_REQUEST_TYPE_TERMINATION, subscriptionId, serviceContextId);
    roSession.sendCreditControlRequest(terminateCCR);

    switchStateMachine(SENT_CCR_TERMINATION);
  }
244653
public static br stop(nitro_service client, br resource) throws Exception
	{
		return ((br[]) resource.perform_operation(client, "stop"))[0];
	}
319213
@Override
    public void stop() {
        try {
            if (randomAccessFile != null) {
                randomAccessFile.close();
                fileChannel.close();
            }
            randomAccessFile = null;
            fileChannel = null;
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
171918
@Override
    public void stop(StopContext context) {
        Runnable asyncStop = () -> {
            synchronized (stopLock) {
                controlledProcessStateServiceSupplier.get().removePropertyChangeListener(propertyChangeListener);
                SuspendController controller = suspendControllerSupplier != null ? suspendControllerSupplier.get() : null;
                if (controller != null) {
                    controller.removeListener(operationListener);
                }
                runningState = null;
                try {
                    listener.cleanup();
                } catch (RuntimeException t) {
                    CoreManagementLogger.ROOT_LOGGER.processStateCleanupError(t, name);
                } finally {
                    context.complete();
                }
            }
        };
        final ExecutorService executorService = executorServiceSupplier.get();
        try {
            try {
                executorService.execute(asyncStop);
            } catch (RejectedExecutionException e) {
                asyncStop.run();
            }
        } finally {
            context.asynchronous();
        }
    }
1203296
public void stop(long millisec) throws ChannelException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "stop " + millisec + "; " + getName());
        }
        // only stop the channel if millisec is 0, otherwise ignore.
        if (millisec == 0) {
            stoppedFlag = true;

            // Stop accepting new connections on the inbound channels
            if (getConfig().isInboundChannel()) {

                try {
                    Tr.info(tc, "CWUDP0002I", new Object[] { getConfig().getExternalName(), displayableHostName, String.valueOf(getConfig().getPort()) });
                } catch (Exception e) {
                    // just debug,since this is on an audit attempt
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(this, tc, "Got exception auditing UDP Channel Stop: " + e);
                    }
                }
            }

            // destroy all the "in use" UDPConnLink. This should close all
            // the sockets held by these connections.
            destroyConnLinks();

        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "stop");
        }
    }
417736
public static void endAccessContext() {
        AccessContext.clearAccessContextOnThread();
        final AccessContext accessContext = SuspendedAccessContext.getAccessContextOnThread();
        if (accessContext != null) { // resume
            AccessContext.setAccessContextOnThread(accessContext);
            SuspendedAccessContext.clearAccessContextOnThread();
        }
    }
1200459
@SuppressWarnings("WeakerAccess")
    public synchronized void stop() {
        if (isRunning()) {
            running.set(false);
            MetadataFinder.getInstance().removeMetadataProvider(metadataProvider);
            for (Database database : databases.values()) {
                //noinspection ResultOfMethodCallIgnored
                database.sourceFile.delete();
            }
            databases.clear();
        }
    }
641502
@TaskAction
  public void stopAction() {
    DevServer server =
        devServers.newDevAppServer(CloudSdkOperations.getDefaultHandler(getLogger()));
    try {
      server.stop(runConfig.toStopConfiguration());
    } catch (AppEngineException ex) {
      getLogger().error("Failed to stop server: " + ex.getMessage());
    }
  }
774245
public void stop(int requestNumber)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "stop", requestNumber);

      // We need to lock this down with a semaphore here to ensure that the 'started' flag is
      // correct by callers of isStarted() - see defect 347591

      checkNotBrowserSession();
      
      SessionStopSendListener listener = new SessionStopSendListener();
      startSemaphore.waitOnIgnoringInterruptions();

      try {
          if (subConsumer != null)
          {
              subConsumer.stop(requestNumber, listener);
          }
          else
          {
              super.stop(requestNumber, listener);
          }
      }
      catch (RuntimeException e) {
          FFDCFilter.processException(e, CLASS_NAME + ".stop",
                                      CommsConstants.CATMAINCONSUMER_STOP_01, this,
                                      new Object[]{subConsumer});

         // the listener may never post because of this, so we post now
         // to ensure the semaphore is not left dangling
         listener.errorOccurred(e);
         if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "stop", e); 
         throw e;
      }
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "stop");
   }
678895
public void stopListening()
    {
        if (isIsolated()) {
            this.loggerManager.popLogListener();
        } else {
            this.observationManager.removeListener(this.logListener.getName());
        }
        this.observationManager.removeListener(this.progress.getName());

        // Make sure the progress is closed
        this.progress.getRootStep().finish();
    }
120152
@Override
    public void stop()
                    throws SISessionUnavailableException, SISessionDroppedException,
                    SIResourceException, SIConnectionLostException,
                    SIErrorException
    {
        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConsumerSession.tc.isEntryEnabled())
            SibTr.entry(CoreSPIConsumerSession.tc, "stop", this);

        //stop the LCP
        _localConsumerPoint.stop();

        if (TraceComponent.isAnyTracingEnabled() && CoreSPIConsumerSession.tc.isEntryEnabled())
            SibTr.exit(CoreSPIConsumerSession.tc, "stop");
    }
1121690
@Override
    public void stop(BundleContext bc) throws Exception {
        RuntimeDelegate.setInstance(null);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "stop", bc);
        }
    }
569090
public synchronized void stop() {
    if (!mStopped) {
      mLoggingWorkerThread.interrupt();
      try {
        mLoggingWorkerThread.join();
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
      } finally {
        mStopped = true;
        mLoggingWorkerThread = null;
        LOG.info("AsyncUserAccessAuditLogWriter thread stopped.");
      }
    }
  }
590212
public void stop()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "stop");
      
    // Lock exclusively for start operations
    mpioLockManager.lockExclusive();
    started = false;
    mpioLockManager.unlockExclusive();
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "stop"); 
  }
601204
private void removeAccount(Account parent, Account child) {
        parent.getChildren().remove(child);
        sendAccountRemoved(parent, child);
    }
571138
public void stop()
  {
    synchronized (startStopLock) {
      running = false;
      taskStatusChecker.shutdownNow();

      if (numRunningTasks > 0) {
        final Iterator<MonitorEntry> iterator = runningTasks.values().iterator();
        while (iterator.hasNext()) {
          final MonitorEntry entry = iterator.next();
          iterator.remove();
          final String taskId = entry.runningTask.getId();
          log.info("Request to kill subtask[%s]", taskId);
          indexingServiceClient.killTask(taskId);
          numRunningTasks--;
          numKilledTasks++;
        }

        if (numRunningTasks > 0) {
          log.warn(
              "Inconsistent state: numRunningTasks[%d] is still not zero after trying to kill all running tasks.",
              numRunningTasks
          );
        }
      }

      log.info("Stopped taskMonitor");
    }
  }
554317
public void stopSyncForMount(long mountId) throws InvalidPathException, IOException {
    LOG.debug("Stop sync for mount id {}", mountId);
    if (mFilterMap.containsKey(mountId)) {
      List<Pair<AlluxioURI, MountTable.Resolution>> toBeDeleted = new ArrayList<>();
      for (AlluxioURI uri : mFilterMap.get(mountId)) {
        MountTable.Resolution resolution = resolveSyncPoint(uri);
        if (resolution != null) {
          toBeDeleted.add(new Pair<>(uri, resolution));
        }
      }
      // Calling stopSyncInternal outside of the traversal of mFilterMap.get(mountId) to avoid
      // ConcurrentModificationException
      for (Pair<AlluxioURI, MountTable.Resolution> deleteInfo : toBeDeleted) {
        stopSyncInternal(deleteInfo.getFirst(), deleteInfo.getSecond());
      }
    }
  }