/*
setMaxInactToZero - called to set the max inactive time to zero for remote invalidateAll.
This will result in the session being invalidated by the next run of the background
invalidator.
500248
int setMaxInactToZero(String sessId, String appName) {
        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[SET_MAX_INACT_TO_ZERO], "for " + sessId + " and app " + appName);
        }
        int rc = 0;
        PreparedStatement psRemoteInval = null;
        Connection con = getConnection(false);
        if (con == null) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[SET_MAX_INACT_TO_ZERO], "DatabaseHashMap.nullConnection");
            return 0;
        }
        try {
            psRemoteInval = con.prepareStatement(remoteInvalAll);
            psRemoteInval.setString(1, sessId);
            psRemoteInval.setString(2, sessId);
            psRemoteInval.setString(3, appName);
            rc = psRemoteInval.executeUpdate();
        } catch (Throwable t) {
            com.ibm.ws.ffdc.FFDCFilter.processException(t, "com.ibm.ws.session.store.db.DatabaseHashMap.setMaxInactToZero", "2417", this);
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[SET_MAX_INACT_TO_ZERO], "CommonMessage.exception", t);
        } finally {
            if (psRemoteInval != null)
                closeStatement(psRemoteInval);
            closeConnection(con);
        }
        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINER)) {
            LoggingUtil.SESSION_LOGGER_WAS.exiting(methodClassName, methodNames[SET_MAX_INACT_TO_ZERO], "for " + sessId + " returning " + rc);
        }
        return rc;
    }
956628
@Nonnull
  public CacheControlBuilder setMaxAge (@Nonnull final TimeUnit eTimeUnit, final long nDuration)
  {
    return setMaxAgeSeconds (eTimeUnit.toSeconds (nDuration));
  }
91681
@Override
    public ManagedProcess waitForExitMaxMsOrDestroy(long maxWaitUntilDestroyTimeout)
            throws ManagedProcessException {
        waitForExitMaxMs(maxWaitUntilDestroyTimeout);
        if (isAlive()) {
            logger.info("Process didn't exit within max. {}ms, so going to destroy it now: {}",
                    maxWaitUntilDestroyTimeout, getProcLongName());
            destroy();
        }
        return this;
    }
1157126
public void setMaxRetryTimeMillis(long maxRetryTimeMillis) {
        if (this.httpClient instanceof DefaultHttpClient) {
            ((DefaultHttpClient) this.httpClient).setMaxRetryTimeMillis(maxRetryTimeMillis);
        }
        else
            throw new UnsupportedOperationException("Invalid operation for class " + this.httpClient.getClass());
    }
870062
public void setTimeLimit(int timeLimit) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  expirationTimeFlag = SET;
	  this.timeLimit = timeLimit;
	  if (timeLimit > 0) {
         long ttlmsec = ((long)timeLimit) * 1000;  
		 expirationTime = ttlmsec + System.currentTimeMillis();
	  }
   }
1132545
@Override
    public synchronized void invalidate(String key, boolean fullExpire) {
        Entry entry = get(key);
        if (entry != null) {
            entry.softTtl = 0;
            if (fullExpire) {
                entry.ttl = 0;
            }
            put(key, entry);
        }

    }
115559
synchronized void setLimits(int txnsPerSec, int maxOutstanding) {
        m_autoTune = false;
        /*
         * If the rate limit is some reasonably low value then go through the effort
         * of rate limiting
         */
        if (txnsPerSec < Integer.MAX_VALUE / 2) {
            m_doesAnyTuning = true;
        }
        m_targetTxnsPerSecond = txnsPerSec;
        m_maxOutstandingTxns = maxOutstanding;
        m_outstandingTxnsSemaphore.drainPermits();
        m_outstandingTxnsSemaphore.release(maxOutstanding);
    }
1087768
@SuppressWarnings("unchecked")
  public T withMaxDuration(Duration maxDuration) {
    Assert.notNull(maxDuration, "maxDuration");
    this.maxDuration = maxDuration;
    return (T) this;
  }
1269274
public void setExecutorTaskMax(int max)
  {
    if (getThreadMax() < max)
      throw new ConfigException(L.l("<thread-executor-max> ({0}) must be less than <thread-max> ({1})",
                                    max, getThreadMax()));

    if (max == 0)
      throw new ConfigException(L.l("<thread-executor-max> must not be zero."));

    _executorTaskMax = max;
  }
678949
private void setNormalizedMaxValue(double value) {
        normalizedMaxValue = Math.max(0d, Math.min(1d, Math.max(value, normalizedMinValue)));
        invalidate();
    }
504763
public void setMaxActiveSipApplicationSessions(int max) {
		int oldMaxActiveSipApplicationSessions = this.sipManagerDelegate.getMaxActiveSipApplicationSessions();
		this.sipManagerDelegate.setMaxActiveSipApplicationSessions(max);
		support
				.firePropertyChange(
						"maxActiveSipApplicationSessions",
						Integer.valueOf(oldMaxActiveSipApplicationSessions),
						Integer.valueOf(
								this.sipManagerDelegate.getMaxActiveSipApplicationSessions()));
	}
340157
public void invalidateAll(boolean remote) throws SecurityException {

        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
            String logString = "(" + remote + ") for app " + appName + " id " + getId();
            LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, "invalidateAll", logString);
        }
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPermission(invalidateAllPerm);
        }
        SessionContextRegistry.getInstance().invalidateAll(getId(), _sessCtx.getAppName(), this, remote, false); // false
                                                                                                                 // indicates
                                                                                                                 // request
                                                                                                                 // was
                                                                                                                 // not
                                                                                                                 // remotely
                                                                                                                 // initiated
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, "invalidateAll");
        }
    }
330512
final Operation setCallTimeout(long callTimeout) {
        this.callTimeout = callTimeout;
        setFlag(callTimeout > Integer.MAX_VALUE, BITMASK_CALL_TIMEOUT_64_BIT);
        return this;
    }
929693
@Override
    public void deactivate() throws InterruptedException, CouldNotPerformException {
        synchronized (maintainerLock) {
            try {
                verifyMaintainability();
                validateInitialization();
            } catch (InvalidStateException ex) {
                // was never initialized!
                return;
            }
            if (connectionState != RECONNECTING) {
                skipSyncTasks();
                setConnectionState(DISCONNECTED);
                if (pingTask != null && !pingTask.isDone()) {
                    pingTask.cancel(true);
                }
            }
            if (listenerWatchDog != null) {
                listenerWatchDog.deactivate();
            }

            if (remoteServerWatchDog != null) {
                remoteServerWatchDog.deactivate();
            }
        }
        synchronized (connectionMonitor) {
            connectionMonitor.notifyAll();
        }
    }
146049
public static void lessThan(long value, long maxValue, String name) {
        if (value <= 0) {
            throw new IllegalArgumentException(name + " should be > 0, current value " + value);
        }
        if (value > maxValue) {
            throw new IllegalArgumentException(name + " should be <= " + maxValue + ", current value " + value);
        }
    }
295598
@Override
    public synchronized void deactivate() throws InterruptedException, CouldNotPerformException {
        manageLock.lockWrite(this);
        try {
            try {
                validateInitialization();
            } catch (InvalidStateException ex) {
                // was never initialized!
                return;
            }

            // skip initial data sync if still running
            if (initialDataSyncFuture != null && !initialDataSyncFuture.isDone()) {
                initialDataSyncFuture.cancel(true);
            }

            logger.debug("Deactivate AbstractControllerServer for: " + this);
            // The order is important: The informer publishes a zero event when the availabilityState is set to deactivating which leads remotes to disconnect
            // The remotes try to reconnect again and start a requestData. If the server is still active it will respond
            // and the remotes will think that the server is still there..
            if (serverWatchDog != null) {
                serverWatchDog.deactivate();
            }
            // inform remotes about deactivation
            setAvailabilityState(DEACTIVATING);
            if (informerWatchDog != null) {
                informerWatchDog.deactivate();
            }
            setAvailabilityState(OFFLINE);
        } finally {
            manageLock.unlockWrite(this);
        }
    }
187020
@Override
    public void addToTimeLimitDaemon(Object id, long expirationTime, int inactivity) {
        final String methodName = "addToTimeLimitDaemon()";
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, methodName + " cacheName=" + cacheName + " ERROR because it should not be called");
        }
    }