Adds a session to the sessions list.

@param session The session to add.
427329
public void openSession(PrimaryBackupSession session) {
    sessions.put(session.sessionId().id(), session);
    listeners.forEach(l -> l.onOpen(session));
  }
338409
public void sessionCreated(ISession session) {
        HttpSession httpsession = (HttpSessionImpl) _adapter.adapt(session);
        HttpSessionEvent event = new HttpSessionEvent(httpsession);
        HttpSessionListener listener = null;

        // synchronized (_sessionListeners) {
        for (int i = 0; i < _sessionListeners.size(); i++) {
            listener = (HttpSessionListener) _sessionListeners.get(i);
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
                LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "sessionCreated", "Calling sessionCreated on listener:" + listener);
            }
            if (!session.isOverflow()) { //PK85530
                listener.sessionCreated(event);
            }
        }
        // }

    }
737786
public static synchronized void serializeSessionAttributes(final HttpSession session) {
		if (session != null) {
			File file = new File(SERIALIZE_SESSION_NAME);

			if (!file.exists() || file.canWrite()) {
				// Retrieve the session attributes
				List data = new ArrayList();

				for (Enumeration keyEnum = session.getAttributeNames();
						keyEnum.hasMoreElements();) {
					String attributeName = (String) keyEnum.nextElement();
					Object attributeValue = session.getAttribute(attributeName);

					if (attributeValue instanceof Serializable) {
						data.add(attributeName);
						data.add(attributeValue);
					} else {
						LOG.error(
								"Skipping attribute \"" + attributeName
								+ "\" as it is not Serializable");
					}
				}

				// Write them to the file
				FileOutputStream fos = null;
				ObjectOutputStream oos = null;

				try {
					fos = new FileOutputStream(file);
					oos = new ObjectOutputStream(fos);

					oos.writeObject(data);
				} catch (Exception e) {
					LOG.error("Failed to write serialized session to " + file, e);
				} finally {
					if (oos != null) {
						StreamUtil.safeClose(oos);
					} else {
						StreamUtil.safeClose(fos);
					}
				}
			} else {
				LOG.warn("Unable to write serialized session to " + file);
			}
		}
	}
265108
@SuppressWarnings("unchecked")
	public void sessionCreated(HttpSessionEvent se) {
		Descriptor<? extends Context> descriptor = container.contexts().get(Session.class);
		
		if (descriptor != null) {
			WebContext<HttpSession> context = (WebContext<HttpSession>) container.component(descriptor);
			context.associate(se.getSession());
		}
	}
209450
def _wrap_sessions(sessions, request):
    
    result = set()
    for s in sessions:
        if s is SELF and request:
            result.add(request.session.session_key)
        else:
            result.add(s)
    return result
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);
	}
942602
public void sessionUserNameSet(ISession session, String oldUserName, String newUserName) {
        _sessionStateEventDispatcher.sessionUserNameSet(session, oldUserName, newUserName);

    }
389665
public final void setSession( AbstractSession session ) throws JMSException
    {
        if (session == null)
            this.sessionRef = null;
        else
        {
        	// Consistency check
        	if (sessionRef != null && sessionRef.get() != session)
        		throw new FFMQException("Message session already set","CONSISTENCY");
        		
            this.sessionRef = new WeakReference<>(session);
        }
    }
108946
private void updateSession(Session newSession) {
        if (this.currentSession == null) {
            this.currentSession = newSession;
        } else {
            synchronized (this.currentSession) {
                this.currentSession = newSession;
            }
        }
    }
481266
public void addSessionToken() {
		// Get the selected parameter
		HtmlParameterStats item = this.getParamsPanel().getSelectedParam();
		if (item != null) {
			
			// If the HttpSessions extension is active, notify it of the new session token
			ExtensionHttpSessions extSession = this.getExtensionHttpSessions();
			if (extSession != null) {
				extSession.addHttpSessionToken(this.getParamsPanel().getCurrentSite(), item.getName());
			}
			
			// Flag the item accordingly
			item.addFlag(HtmlParameter.Flags.session.name());
			// Repaint so change shows up
			this.getParamsPanel().getParamsTable().repaint();
		}
	}
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);
        }
    }
503877
def put(self, session):
        
        try:
            self._sessions.put_nowait(session)
        except queue.Full:
            try:
                session.delete()
            except NotFound:
                pass
265017
public void addSessionObject(BaseSession sessionObject)
    {
        if (sessionObject == null)
            return;
        if (m_vSessionObjectList == null)
            m_vSessionObjectList = new Vector<BaseSession>();
        m_vSessionObjectList.addElement(sessionObject);
    }
1113137
private void initialize() {
        this.setLayout(new CardLayout());
        this.setName(Constant.messages.getString("session.general"));
        this.add(getPanelSession(), getPanelSession().getName());
	}
148031
public void expireSession(PrimaryBackupSession session) {
    if (sessions.remove(session.sessionId().id()) != null) {
      session.expire();
      listeners.forEach(l -> l.onExpire(session));
    }
  }
478150
def add(self, session):
        
        self._items[session.session_id] = session

        if session.expiry is not None:
            self._queue.push(session)
763756
final void sessionClosed(final JmsJcaSessionImpl session) {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "sessionClosed", session);
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            SibTr.debug(this, TRACE, "Sending connection closed events to the "
                                     + _connectionListeners.size() + " listeners");
        }

        final ConnectionEvent event = new ConnectionEvent(this,
                        ConnectionEvent.CONNECTION_CLOSED);
        event.setConnectionHandle(session);

        // Copy list to protect against concurrent modification by listener
        final List<ConnectionEventListener> copy;
        synchronized (_connectionListeners) {
            copy = new ArrayList<ConnectionEventListener>(_connectionListeners);
        }

        for (final Iterator iterator = copy.iterator(); iterator.hasNext();) {
            final Object object = iterator.next();
            if (object instanceof ConnectionEventListener) {
                ((ConnectionEventListener) object).connectionClosed(event);
            }
        }

        _sessions.remove(session);

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "sessionClosed");
        }

    }