Polls the host at the specified interval for asynchronous activity.

@param session Session whose host is to be polled.
488832
private void pollHost(BrokerSession session) {
        Request request = !enabled ? null : getRequest(session.pollingAction(), session);
        
        if (request == null) {
            return;
        }
        
        try {
            Response response = session.netCall(request, 1000);
            String results[] = response.getData().split(Constants.LINE_SEPARATOR, 2);
            String params[] = StrUtil.split(results[0], StrUtil.U, 2);
            
            switch (response.getResponseType()) {
                case ACK: // A simple server acknowledgement
                    int i = StrUtil.toInt(params[0]);
                    
                    if (i > 0) {
                        pollingInterval = i * 1000;
                    }
                    
                    FMDate hostTime = new FMDate(params[1]);
                    session.setHostTime(hostTime);
                    break;
                
                case ASYNC: // Completed asynchronous RPC
                    int asyncHandle = StrUtil.toInt(params[0]);
                    int asyncError = StrUtil.toInt(params[1]);
                    
                    if (asyncHandle > 0) {
                        if (asyncError != 0) {
                            session.onRPCError(asyncHandle, asyncError, results[1]);
                        } else {
                            session.onRPCComplete(asyncHandle, results[1]);
                        }
                    }
                    break;
                
                case EVENT: // Global event for delivery
                    List<IHostEventHandler> hostEventHandlers = session.getHostEventHandlers();
                    
                    if (hostEventHandlers != null) {
                        try {
                            String eventName = results[0];
                            Object eventData = SerializationMethod.deserialize(results[1]);
                            
                            for (IHostEventHandler hostEventHandler : hostEventHandlers) {
                                try {
                                    hostEventHandler.onHostEvent(eventName, eventData);
                                } catch (Throwable e) {
                                    log.error("Host event subscriber threw an exception", e);
                                }
                            }
                        } catch (Throwable e) {
                            log.error("Error processing host event", e);
                        }
                    }
                    break;
            }
        } catch (Throwable e) {
            log.error("Error processing polling response.", e);
            terminate();
        }
    }
505844
public void addSession(Session session) {
		InetSocketAddress remoteSocketAddress = session
				.getRemoteSocketAddress();
		log.warn("Add a session: "
				+ SystemUtils.getRawAddress(remoteSocketAddress) + ":"
				+ remoteSocketAddress.getPort());
		this.sessionList.add(session);
	}
334267
@Override
  @SuppressWarnings("unchecked")
  public void sessionTimerCanceled(ServerRfSession appSession, ScheduledFuture timer) throws InternalException {
    logger.info("sessionTimerCanceled :: appSession[" + appSession + "]");
  }
341984
protected void initSessionConfig(XmlParser.Node node)
    {
        XmlParser.Node tNode=node.get("session-timeout");
        if(tNode!=null)
        {
            int timeout=Integer.parseInt(tNode.toString(false,true));
            getWebApplicationHandler().setSessionInactiveInterval(timeout*60);
        }
    }
356956
public void removeHttpSession(HttpSession session) {
		if (session == activeSession) {
			activeSession = null;
		}
		synchronized (this.sessions) {
			this.sessions.remove(session);
		}
		this.model.removeHttpSession(session);
		session.invalidate();
	}
443166
private void beforeSessionEvent() throws NewSessionException {
    RemoteProxy p = session.getSlot().getProxy();
    if (p instanceof TestSessionListener) {
      try {
        ((TestSessionListener) p).beforeSession(session);
      } catch (Exception e) {
        log.severe("Error running the beforeSessionListener : " + e.getMessage());
        e.printStackTrace();
        throw new NewSessionException("The listener threw an exception ( listener bug )", e);
      }
    }
  }
573107
@Override
    public void dispose(final Session session) {
        if (session != null && session.isConnected()) {
            logger.trace("Disposing of hibernate session.");
            session.close();
        }
    }
835270
public void sessionCreated(ISession session) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "sessionCreated", "sessionObservers.size()=" + _sessionObservers.size());
        }
        if (_sessionObservers == null || _sessionObservers.size() < 1) {
            return;
        }
        ISessionObserver sessionObserver = null;
        for (int i = 0; i < _sessionObservers.size(); i++) {
            sessionObserver = (ISessionObserver) _sessionObservers.get(i);
            sessionObserver.sessionCreated(session);
        }
    }
1051243
public void removeHttpSession(final HttpSession session) {
		if (View.isInitialised() && !EventQueue.isDispatchThread()) {
			EventQueue.invokeLater(new Runnable() {

				@Override
				public void run() {
					removeHttpSession(session);
				}
			});

			return;
		}

		int index = sessions.indexOf(session);
		sessions.remove(index);
		fireTableRowsDeleted(index, index);
	}
1048979
public void addHttpSession(final HttpSession session) {
		if (View.isInitialised() && !EventQueue.isDispatchThread()) {
			EventQueue.invokeLater(new Runnable() {

				@Override
				public void run() {
					addHttpSession(session);
				}
			});

			return;
		}

		if (sessions.contains(session))
			return;
		sessions.add(session);
		final int affectedRow = sessions.size() - 1;
		fireTableRowsInserted(affectedRow, affectedRow);
	}
577983
private void indexQuery(QueryEntry entry, ServerSessionContext session, CompletableFuture<QueryResponse> future) {
    // If the query index is greater than the session's last applied index, queue the request for handling once the
    // state machine is caught up.
    if (entry.getIndex() > session.getLastApplied()) {
      session.registerIndexQuery(entry.getIndex(), () -> applyQuery(entry, future));
    } else {
      applyQuery(entry, future);
    }
  }
20655
public void addHttpSession(HttpSession session) {
		synchronized (this.sessions) {
			this.sessions.add(session);
		}
		this.model.addHttpSession(session);
	}
1211207
private void poll()
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        // Note: A ReferenceQueue is thread safe and may be accessed concurrently
        //       from multiple threads. However, a BeanO should only be destroyed
        //       on a single thread, which is fine since its key will be returned
        //       from poll() only once.

        BeanO bean = null;
        int removeCount = 0;
        Reference<? extends EJSWrapperBase> ref;
        while ((ref = ivRefQueue.poll()) != null)
        {
            synchronized (ivCache)
            {
                bean = ivCache.remove(ref);
            }
            ++removeCount;

            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(tc, "poll : removed (" + ref + ", " + bean + ")");

            // It is possible a bean was removed during clear, and yet the
            // wrapper is still on the reference queue, so handle null.
            if (bean != null) {
                bean.destroy();
            }
        }
        if (isTraceOn && tc.isDebugEnabled())
            Tr.debug(tc, "poll : size = " + ivCache.size() + ", removed = " + removeCount);
    }
308142
protected void connectionClosed(IoSession session) {
		this.connected = false;
		this._disconnect();
		log.info("Connection lost to aggregator at {}:{}", this.host,
				Integer.valueOf(this.port));

		while (this.stayConnected) {
			try {
				Thread.sleep(this.connectionRetryDelay);
			} catch (InterruptedException ie) {
				// Ignored
			}
			log.warn("Reconnecting to aggregator at {}:{}", this.host,
					Integer.valueOf(this.port));
			if (this.connect(this.connectionTimeout)) {
				return;
			}
			log.warn("Failed to reconnect to aggregator at {}:{}", this.host,
					Integer.valueOf(this.port));

		}
		this.finishConnection();

	}
741285
public static int timezoneOffset(H.Session session) {
        String s = null != session ? session.get(SESSION_KEY) : null;
        return S.notBlank(s) ? Integer.parseInt(s) : serverTimezoneOffset();
    }
336975
@Override
  public void onSessionStarted(Session session) {
    session.setUseBlockingRead(true);
    session.setAttribute(HEART_BEAT_FAIL_COUNT_ATTR, new AtomicInteger(0));
    for (MemcachedClientStateListener listener : this.client.getStateListeners()) {
      listener.onConnected(this.client, session.getRemoteSocketAddress());
    }
    this.listener.onConnect((MemcachedTCPSession) session, this.client);
  }
1303593
public static int setSessionTimeout(final int interval)
	{
		final HttpSession session = getHttpSession();
		if (session != null)
		{
			session.setMaxInactiveInterval(interval);
			return interval;
		}
		return -1;
	}