Resets the backoff counter.
<p>
This method should be called after a GCM call succeeds.

@param context application's context.
428062
static void resetBackoff(Context context) {
        Log.d(TAG, "resetting backoff for " + context.getPackageName());
        setBackoff(context, DEFAULT_BACKOFF_MS);
    }
303712
private void clearReset(final OperationContext context) {

        context.getCoordinator().clearStatement(context.getUnit().getId(), "selected.entity");

        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
            @Override
            public void execute() {
                context.getCoordinator().reset();
            }
        });
    }
113166
protected void deactivate(ComponentContext context) throws Exception {

        contextProviders.deactivate(context);
        bvalRef.deactivate(context);
        tranInflowManagerRef.deactivate(context);
        tranSyncRegistryRef.deactivate(context);
        jcaSecurityContextRef.deactivate(context);

        latch.countDown();
        latches.remove(resourceAdapterID, latch);

        FutureMonitor futureMonitor = futureMonitorSvc;
        Future<Boolean> future = appsStoppedFuture.getAndSet(null);
        if (futureMonitor != null && future != null) {
            futureMonitor.onCompletion(future, new CompletionListener<Boolean>() {
                @Override
                public void successfulCompletion(Future<Boolean> future, Boolean result) {
                    stopResourceAdapter();
                }

                @Override
                public void failedCompletion(Future<Boolean> future, Throwable t) {
                    stopResourceAdapter();
                }
            });
        } else {
            stopResourceAdapter();
        }
    }
922584
protected void stop() throws Exception {
		this.logger.debug("Stopping application");
		this.stopLock.lock();
		try {
			for (ConfigurableApplicationContext context : this.rootContexts) {
				context.close();
				this.rootContexts.remove(context);
			}
			cleanupCaches();
			if (this.forceReferenceCleanup) {
				forceReferenceCleanup();
			}
		}
		finally {
			this.stopLock.unlock();
		}
		System.gc();
		System.runFinalization();
	}
167297
public void reset() {

        if (refCount.get() > 0 && isRefCountingEnabled()) {
            Tr.warning(tc, "reset called on " + id + " with a refCount of " + refCount);
            Thread.dumpStack();
        }

        cacheName = null;
        drsClock = -1;
        timeStamp = -1;
        serializedId = null;
        id = null;
        if (useByteBuffer && this.value != null) {
            if (this.value instanceof DistributedNioMapObject) {
                ((DistributedNioMapObject) this.value).release();
            }
        }
        serializedValue = null;
        value = null;
        clock = CacheConfig.DEFAULT_PRIORITY;
        refCount.set(0);
        priority = CacheConfig.DEFAULT_PRIORITY;
        timeLimit = -1;
        inactivity = -1;
        expirationTime = -1;
        validatorExpirationTime = -1;
        removeWhenUnpinned = false;
        _templates = EMPTY_STRING_ARRAY;
        _dataIds = EMPTY_OBJECT_ARRAY;
        _serializedDataIds = null;
        pendingRemoval = false;
        sharingPolicy = EntryInfo.NOT_SHARED;
        persistToDisk = true;
        isOverflowEntry = false;
        lruEvicted = false;
        lruHead = null;
        useByteBuffer = false;
        aliasList = EMPTY_OBJECT_ARRAY;
        serializedAliasList = null;
        userMetaData = null;
        serializedUserMetaData = null;
        loadedFromDisk = false;
        cacheType = CACHE_TYPE_DEFAULT;
        skipValueSerialized = false;
        skipMemoryAndWriteToDisk = false;
        skipMemoryAndWriteToDiskErrorCode = HTODDynacache.NO_EXCEPTION;
        valueHashcode = 0;
        externalCacheGroupId = null;
    }
1240154
public static void shutdown(final LoggerContext context) {
        if (context != null && context instanceof Terminable) {
            ((Terminable) context).terminate();
        }
    }
505017
@Override
	public void resetStats()
    {
    	super.resetStats();
    	sentToQueueCount.set(0);
    	receivedFromQueueCount.set(0);
    	acknowledgedGetCount.set(0);
    	rollbackedGetCount.set(0);
    	expiredCount.set(0);
    }
806826
protected void deactivate(ComponentContext context) {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "deactivate");

        lock.writeLock().lock();
        try {
            if (isInitialized) {
                if (classloader != null) {
                    if (isDerbyEmbedded.get())
                        shutdownDerbyEmbedded();
                    classloader = null;
                }
                for (Iterator<Class<? extends CommonDataSource>> it = introspectedClasses.iterator(); it.hasNext(); it.remove())
                    Introspector.flushFromCaches(it.next());
                isInitialized = false;
            }
        } finally {
            lock.writeLock().unlock();
        }

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "deactivate");
    }
1334705
public final void reset() {
		unblocked = false;
		result = null;
		error = null;
		cancel = null;
		listenersInline = null;
	}
893236
public void close(Context context) {
        client.clean(context.getApplicationContext());
        if (db != null) {
            db.closeDatabase();
        }
    }
412484
public static void clear() throws BackingStoreException {
		try {
			systemRoot.clear();
		} catch (final Exception e) {
			System.err.print(e);
		}
	}
663817
protected synchronized void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "Deactivating");
        }

        // Unregister all services that we registered.
        while (!sslOptions.isEmpty()) {
            Iterator<Map.Entry<String, SSLChannelOptions>> i = sslOptions.entrySet().iterator();
            while (i.hasNext()) {
                Map.Entry<String, SSLChannelOptions> entry = i.next();
                entry.getValue().unregister();
                i.remove();
            }
        }
        sslConfigs.deactivate(context);

        cfwBundle.getFramework().deregisterFactories(this);

        bContext = null;

        // clear the instance if we haven't been replaced.
        instance.compareAndSet(this, null);
    }
822488
def _backoff(self, context):
        # type: (ExponentialRetryWithMaxWait,
        #        azure.storage.common.models.RetryContext) -> int
        
        self._backoff_count += 1
        if self._backoff_count == 1:
            self._last_backoff = self.initial_backoff
        else:
            self._last_backoff *= 2
        if self._last_backoff > self.max_backoff and self.reset_at_max:
            self._backoff_count = 1
            self._last_backoff = self.initial_backoff
        return self._last_backoff
336330
@Override
    public synchronized void stop(final StopContext context) {
        httpManagementConsumer.accept(null);
        ListenerRegistry lr = listenerRegistrySupplier.get();
        if(lr != null) {
            lr.removeListener(HTTP_MANAGEMENT);
            lr.removeListener(HTTPS_MANAGEMENT);
        }
        if (serverManagement != null) {
            try {
                serverManagement.stop();
            } finally {
                serverManagement = null;

                // Unregister sockets from the SBM
                if (socketBindingManager != null) {
                    ManagedBindingRegistry registry = useUnmanagedBindings ? socketBindingManager.getUnnamedRegistry() : socketBindingManager.getNamedRegistry();
                    if (basicManagedBinding != null) {
                        registry.unregisterBinding(basicManagedBinding);
                        basicManagedBinding = null;
                    }
                    if (secureManagedBinding != null) {
                        registry.unregisterBinding(secureManagedBinding);
                        secureManagedBinding = null;
                    }
                    socketBindingManager = null;
                    useUnmanagedBindings = false;
                }
            }
        }
    }
274288
public void onResume(final Context context) {
        new Handler().post(new Runnable() {
            @Override
            public void run() {
                checkLocaleChange(context);
                checkAfterLocaleChanging();
            }
        });
    }
356187
protected void deactivate(ComponentContext context) {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "deactivate", name);

        lock.writeLock().lock();
        try {
            if (pmMBean != null) {
                pmMBean.unregister();
                pmMBean = null;
            }
            pm = null;
            properties = null;
        } finally {
            lock.writeLock().unlock();
        }

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "deactivate");
    }
922085
private void removeContext(final String contextID) {

    synchronized (this.contextStack) {

      if (!contextID.equals(this.contextStack.peek().getIdentifier())) {
        throw new IllegalStateException("Trying to close context with id `" + contextID +
            "`. But the top context has id `" +
            this.contextStack.peek().getIdentifier() + "`");
      }

      this.contextStack.peek().close();
      if (this.contextStack.size() > 1) {
        /* We did not close the root context. Therefore, we need to inform the
         * driver explicitly that this context is closed. The root context notification
         * is implicit in the Evaluator close/done notification.
         */
        this.heartBeatManager.sendHeartbeat(); // Ensure Driver gets notified of context DONE state
      }
      this.contextStack.pop();
      /*
      * At this moment, the Evaluator is actually idle and has some time till the Driver sends it additional work.
      * Also, a potentially large object graph just became orphaned: all the objects instantiated by the context
      * and service injectors can now be garbage collected. So GC call is justified.
      * */
      System.gc();
    }
  }