Applies a close session entry to the state machine.
421395
private void applyCloseSession(Indexed<CloseSessionEntry> entry) {
    RaftSession session = raft.getSessions().getSession(entry.entry().session());

    // If the server session is null, the session either never existed or already expired.
    if (session == null) {
      throw new RaftException.UnknownSession("Unknown session: " + entry.entry().session());
    }

    RaftServiceContext service = session.getService();
    service.closeSession(entry.index(), entry.entry().timestamp(), session, entry.entry().expired());

    // If this is a delete, unregister the service.
    if (entry.entry().delete()) {
      raft.getServices().unregisterService(service);
      service.close();
    }
  }
508686
@Override
    public void close() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "close");

        int originalState = 0;
        Object[] enumCopy = null;

        synchronized (enums) {
            // Save the state of the closed flag before we update it here. If
            // this is the first time that close has been called then we want
            // to carry out the logic, otherwise silently complete with no
            // further action.
            originalState = state;
            state = CLOSED;

            // Make sure that we do this part inside the sync block too in order
            // to prevent concurrent modification problems.
            enumCopy = enums.toArray();
        }

        if (originalState != CLOSED) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "About to close " + enumCopy.length + " enums.");
            for (int i = 0; i < enumCopy.length; i++) {
                EnumImpl anEnum = (EnumImpl) enumCopy[i];
                anEnum.close();
            }

            // Remove from the list maintained in the session.
            theSession.removeBrowser(this);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "close");
    }
805733
protected void onSessionClose(SessionImpl session) {
        Lock lock = lockManager.getLock(getLockingKey(session.keyspace()));
        lock.lock();
        try {
            if (keyspaceCacheMap.containsKey(session.keyspace())) {
                KeyspaceCacheContainer cacheContainer = keyspaceCacheMap.get(session.keyspace());
                cacheContainer.removeSessionReference(session);
                // If there are no more sessions associated to current keyspace,
                // close graph and remove reference from cache.
                if (cacheContainer.referenceCount() == 0) {
                    JanusGraph graph = cacheContainer.graph();
                    graph.close();
                    keyspaceCacheMap.remove(session.keyspace());
                }
            }
        } finally {
            lock.unlock();
        }
    }
1064317
def close(self):
        
        try:
            logger.debug('%s - closing', self._resource_name,
                         extra=self._logging_extra)
            self.before_close()
            self.visalib.close(self.session)
            logger.debug('%s - is closed', self._resource_name,
                         extra=self._logging_extra)
            self.session = None
        except errors.InvalidSession:
            pass
943570
private void releaseCloseLock()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "releaseCloseLock");
      closeLock.readLock().unlock();
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "releaseCloseLock");
   }
951881
public function handler_close() {
        if ($this->recordid) {
            try {
                $this->database->release_session_lock($this->recordid);
            } catch (\Exception $ex) {
                // Ignore any problems.
            }
        }
        $this->recordid = null;
        $this->lasthash = null;
        return true;
    }
914311
def close(self):
        """"""
        if not self.lock_disable and self.session_config_lock:
            self._unlock()
        self.device.close()
1285464
def close(self, code=3000, message='Go away!'):
        
        if self.state != SESSION_STATE.CLOSED:
            try:
                self.conn.connectionLost()
            except Exception as e:
                log.msg("Failed to call connectionLost(): %r." % e)
            finally:
                self.state = SESSION_STATE.CLOSED
                self.close_reason = (code, message)

            # Bump stats
            self.stats.sessionClosed(self.transport_name)

            # If we have active handler, notify that session was closed
            if self.handler is not None:
                self.handler.session_closed()
399597
protected void setOpen () {
     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setOpen");
     closed = false;
     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setOpen");
   }
520232
public static function write_close() {

        if ( self::$sessionState === self::SESSION_STARTED ) {
            self::$sessionState = self::SESSION_NOT_STARTED;

            return session_write_close();
        }

        return true;
    }
56074
def apply_all(self):
        
        if self.__closed:
            raise MigrationSessionError("Can't apply applied session")
        if self._to_apply:
            raise MigrationSessionError("Can't apply_all with migrations added to session")

        try:
            self.__apply(run_all=True)
        except:
            raise
        finally:
            self.__closed = True
971471
def close(self):
        """"""
        if self.session is not None:
            self.session.cookies.clear()
            self.session.close()
            self.session = None
1250134
def close(self, code=3000, message='Go away!'):
        
        if self.state != CLOSED:
            try:
                self.conn.on_close()
            except:
                LOG.debug("Failed to call on_close().", exc_info=True)
            finally:
                self.state = CLOSED
                self.close_reason = (code, message)
                self.conn = None

            # Bump stats
            self.stats.on_sess_closed(self.transport_name)

            # If we have active handler, notify that session was closed
            if self.handler is not None:
                self.handler.session_closed()
1041081
def close_state_machine(self, widget, page_number, event=None):
        
        page = widget.get_nth_page(page_number)
        for tab_info in self.tabs.values():
            if tab_info['page'] is page:
                state_machine_m = tab_info['state_machine_m']
                self.on_close_clicked(event, state_machine_m, None, force=False)
                return
214412
public final void close() {
        synchronized (this.lock) {
            final SessionState oldState = this.state;

            switch (this.state) {
                case CREATED:
                case OPENING:
                    this.state = SessionState.CLOSED_LOGIN_FAILED;
                    postStateChange(oldState, this.state, new FacebookException(
                            "Log in attempt aborted."));
                    break;

                case CREATED_TOKEN_LOADED:
                case OPENED:
                case OPENED_TOKEN_UPDATED:
                    this.state = SessionState.CLOSED;
                    postStateChange(oldState, this.state, null);
                    break;

                case CLOSED:
                case CLOSED_LOGIN_FAILED:
                    break;
            }
        }
    }
1342126
def close_database_session(session):
    """"""

    try:
        session.close()
    except OperationalError as e:
        raise DatabaseError(error=e.orig.args[1], code=e.orig.args[0])
129118
def apply(self):
        
        if self.__closed:
            raise MigrationSessionError("Can't apply applied session")
        try:
            while self._to_apply:
                self.__apply(migration=self._to_apply.pop(0))
        except:
            raise
        finally:
            self.__closed = True