Restart alarms for a a list of BTEs

@param timedout the list of BTEs to be restarted
504582
private void restartEntries(List timedout)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "restartEntries", new Object[] { timedout });

    //iterate over the list of entries
    Iterator itr = timedout.iterator();
    while(itr.hasNext())
    {
      BatchedTimeoutEntry bte = (BatchedTimeoutEntry)itr.next();
      //get the BTE's entry in the active list
      LinkedListEntry entry = bte.getEntry();
      //if it is not in the list (i.e. the entry is null) then it has already been removed
      if(entry != null && activeEntries.contains(entry))
      {
        //start a new alarms
        startNewAlarm(entry);
      }
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    	SibTr.exit(tc, "restartEntries");
  }
1329936
public void alarm (Object alarmContext)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "alarm", alarmContext);

    synchronized(this) {
      _alarm = null;
    }

    try {
      completeBatch(true);
    } catch(SIException e) {
      //No FFDC code needed
      SibTr.exception(this, tc, e);
      //can't do anything else here
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "alarm");
  }
285519
private void timeoutExpired(final Timeout timeout, final TimeoutContext context) {
        try {
            removeExpiredTimeout(timeout);

            for (TimeoutExpired callback : callbacks) {
                if (callback instanceof TimeoutExpirationCallback) {
                    ((TimeoutExpirationCallback) callback).expired(timeout, context);
                } else {
                    callback.expired(timeout);
                }
            }
        } catch (Exception ex) {
            // catch all exceptions. otherwise calling timeout thread of timers thread pool will be terminated.
            LOG.error("Error handling timeout.", ex);
        }
    }
549784
@Deprecated
  public AtomixClusterBuilder withReachabilityTimeout(Duration timeout) {
    GroupMembershipProtocolConfig protocolConfig = config.getProtocolConfig();
    if (protocolConfig instanceof HeartbeatMembershipProtocolConfig) {
      ((HeartbeatMembershipProtocolConfig) protocolConfig).setFailureTimeout(timeout);
    }
    return this;
  }
611826
public FluoConfiguration setConnectionRetryTimeout(int timeoutMS) {
    Preconditions.checkArgument(timeoutMS >= -1,
        CONNECTION_RETRY_TIMEOUT_MS_PROP + " must be >= -1");
    setProperty(CONNECTION_RETRY_TIMEOUT_MS_PROP, timeoutMS);
    return this;
  }
1258149
public void setTimeout(ScheduledExecutorService timeoutExecutor, long timeout, TimeUnit unit) {
      cancelTimeoutTask();
      ScheduledFuture<Void> timeoutFuture = timeoutExecutor.schedule(this, timeout, unit);
      setTimeoutFuture(timeoutFuture);
   }
589694
function(timeout, how_many_intervals){
    var that = this;

    that.timeout = timeout;
    that.not_poked = 0;

    that._onTimeout = function(){
        that.not_poked += 1;
        if (that.not_poked === how_many_intervals) {
            that.emit('timeout');
        }
        that._restartTimeout();
    };
    that._restartTimeout();
}
1273429
public void setTimeout(int timeout) {
    this.timeout = timeout;
    try {
      socket.setSoTimeout(timeout);
    } catch (SocketException sx) {
      LOGGER.warn("Could not set socket timeout.", sx);
    }
  }
103553
public void alarm(final Object context) {
      long sleepInterval = 0;
      do {
         long startWakeUpTime = System.currentTimeMillis();
         try {
            wakeUp(startDaemonTime, startWakeUpTime);
         } catch (Exception ex) {
            com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.RealTimeDaemon.alarm", "83", this);
            if (tc.isDebugEnabled())
               Tr.debug(tc, "exception during wakeUp", ex);
         }
         sleepInterval = timeInterval - (System.currentTimeMillis() - startWakeUpTime);
         // keep looping while we are behind... (i.e. execution time is greater than the time interval)
      } while (sleepInterval <= 0);
      
      if (false == stopDaemon){    	  
			Scheduler.createNonDeferrable(sleepInterval, context,
					new Runnable() {
						@Override
						public void run() {
							alarm(context);
						}
					}); 	  
      }      
   }
1034840
public void processTimedoutEntries(List timedout)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "processTimedoutEntries", new Object[] {this,timedout});

    boolean sendMsg = false;
    synchronized (this)
    {
      if (active && completedTicksInitialized && !timedout.isEmpty())
      {
        sendMsg = true;
      }
    }
    if (sendMsg)
      parent.sendDecisionExpected(remoteMEUuid, gatheringTargetDestUuid, streamId, timedout);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "processTimedoutEntries");
  }
173675
void reset(long time,
             long latest,
             AlarmListener listener,
             Object context,
             long index)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "reset",
        new Object[] { new Long(time), new Long(latest), listener, context, new Long(index) });
    
    data = listener;
    this.time = time;
    this.latest = latest;
    this.context = context;
    this.index = index;
    //check if this alarm has a group listener
    groupListener = (listener instanceof GroupAlarmListener);
    //flag as not canceled 
    active = true;
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "reset");
  }
902039
private int restart(final boolean basic, final Destination dst, final int eraseCode,
		final int channel) throws KNXTimeoutException, KNXRemoteException, KNXLinkClosedException,
		KNXDisconnectException, InterruptedException
	{
		int time = 0;
		if (basic) {
			send(dst, priority, DataUnitBuilder.createLengthOptimizedAPDU(RESTART, null), 0);
		}
		else {
			final byte[] sdu = new byte[] { 0x01, (byte) eraseCode, (byte) channel, };
			final byte[] send = DataUnitBuilder.createLengthOptimizedAPDU(RESTART, sdu);
			final byte[] apdu = sendWait2(dst, priority, send, RESTART, 3, 3);
			// check we get a restart response
			if ((apdu[1] & 0x32) == 0)
				throw new KNXInvalidResponseException("restart response bit not set");
			// defined error codes: 0,1,2,3
			final String[] codes = new String[] { "Success", "Access Denied",
				"Unsupported Erase Code", "Invalid Channel Number", "Unknown Error" };
			final int error = Math.min(apdu[2] & 0xff, 4);
			if (error > 0)
				throw new KNXRemoteException("master reset: " + codes[error]);
			time = ((apdu[3] & 0xff) << 8) | (apdu[4] & 0xff);
		}

		if (dst.isConnectionOriented()) {
			// a remote endpoint is allowed to not send a TL disconnect before restart, but
			// a TL disconnect timeout shall not be treated as protocol error
			final Object lock = new Object();
			final TransportListener l = new TLListener()
			{
				@Override
				public void disconnected(final Destination d)
				{
					if (d.equals(dst))
						synchronized (lock) {
							lock.notify();
						}
				};
			};
			tl.addTransportListener(l);
			try {
				synchronized (lock) {
					while (dst.getState() != Destination.State.Disconnected)
						lock.wait();
				}
			}
			finally {
				tl.removeTransportListener(l);
			}
			// always force a disconnect from our side
			tl.disconnect(dst);
		}
		return time;
	}
1190264
def revive(self, timeout=None):
        
        if timeout is not None:
            self.timeout = timeout

        self.revive_event.set()
915472
def timeout(timeout_time, default):
        '''
        
        '''
        def timeout_function(f):
            def f2(*args):
                def timeout_handler(signum, frame):
                    raise MethodTimer.DecoratorTimeout()

                old_handler = signal.signal(signal.SIGALRM, timeout_handler)
                # triger alarm in timeout_time seconds
                signal.alarm(timeout_time)
                try:
                    retval = f(*args)
                except MethodTimer.DecoratorTimeout:
                    return default
                finally:
                    signal.signal(signal.SIGALRM, old_handler)
                signal.alarm(0)
                return retval
            return f2
        return timeout_function
644600
public SleepBuilder<T> withTimeout(long timeout, TimeUnit timeUnit) {
        this.timeout = timeUnit.toMillis(timeout);
        return this;
    }
283401
public void setTimeout(int timeout) {
        this.timeout = timeout;



        httpClient.connectTimeout(timeout, TimeUnit.MILLISECONDS);
        httpClient.readTimeout(timeout, TimeUnit.MILLISECONDS);
        httpClient.writeTimeout(timeout, TimeUnit.MILLISECONDS);

    }
796015
public static void logTimeoutException(final Logger logger,
			final TimeoutException e)
	{

		logger.logException(Level.WARN, "TimeoutException", e);
	}