/*
(non-Javadoc)
@see
org.exoplatform.services.jcr.ext.app.SessionProviderService#removeSessionProvider(java.lang
.Object)
9287
public void removeSessionProvider(Object key)
   {
      if (providers.containsKey(key))
      {
         getSessionProvider(key).close();
         providers.remove(key);
      }

      if (systemProviders.containsKey(key))
      {
         systemProviders.get(key).close();
         systemProviders.remove(key);
      }
   }
384436
@Override
	public Collection<String> removeSessionsToTopic(Collection<Session> sessions) {
		if (sessions != null && !sessions.isEmpty()) {
			Collection<String> topicUpdated = new ArrayList<>();
			for (String topic : map.keySet()) {
				if(unregisterTopicSessions(topic, sessions)) {
					topicUpdated.add(topic);
					sendSubscriptionEvent(Constants.Topic.SUBSCRIBERS + Constants.Topic.COLON + topic, getNumberSubscribers(topic));
				}
			}
			return topicUpdated;
		}
		return Collections.EMPTY_LIST;
	}
995724
public void destroySession() {
    	JsonObject session = get("session");
        if (session == null) {
            return;
        }

        String sessionId = session.getString("id");
        // remove from the context
        put("session", null);

        if (sessionId == null) {
            return;
        }

        store.destroy(sessionId, new Handler<Object>() {
            @Override
            public void handle(Object error) {
                if (error != null) {
                    // TODO: better handling of errors
                    System.err.println(error);
                }
            }
        });
    }
418116
void destroy( HttpSession session )
    {
        onDestroy();    // for backwards compatiblity
        super.destroy( session );

        //
        // We may have lost our transient ServletContext reference.  Try to get the ServletContext reference from the
        // HttpSession object if necessary.
        //
        ServletContext servletContext = getServletContext();
        if ( servletContext == null && session != null ) servletContext = session.getServletContext();

        if ( servletContext != null )
        {
            PageFlowEventReporter er = AdapterManager.getServletContainerAdapter( servletContext ).getEventReporter();
            er.flowControllerDestroyed( this, session );
        }
    }
929198
private Session removeSession(String id) {
        try {
            Session session = sessionCache.delete(id);
            if (session != null) {
                session.beginInvalidate();
                for (int i = sessionListeners.size() - 1; i >= 0; i--) {
                    sessionListeners.get(i).sessionDestroyed(session);
                }
            }
            return session;
        } catch (Exception e) {
            log.warn("Failed to delete session", e);
            return null;
        }
    }
361228
@Override
  public NetworkReqListener removeSessionListener(String sessionId) {
    if (this.localDataSource.exists(sessionId)) {
      return this.localDataSource.removeSessionListener(sessionId);
    }
    else if (!this.localMode && this.existReplicated(sessionId)) {
      // does not make much sense ;[
      this.makeLocal(sessionId);
      return this.localDataSource.removeSessionListener(sessionId);
    }

    return null;
  }
1231282
int removeSessionToSessions(Session session, Collection<Session> sessions) {
		if (sessions != null) {
			if (sessions.remove(session)) {
				return 1;
			}
		}
		return 0;
	}
883566
public void removeCorrespondingSipApplicationSession(MobicentsSipApplicationSessionKey sipApplicationSession) {
		joinApplicationSession.remove(sipApplicationSession);
		replacesApplicationSession.remove(sipApplicationSession);
		Iterator<MobicentsSipApplicationSessionKey> it = joinApplicationSession.values().iterator();
		boolean found = false;
		while (it.hasNext() && !found) {
			MobicentsSipApplicationSessionKey sipApplicationSessionKey = it.next();
			if(sipApplicationSessionKey.equals(sipApplicationSession)) {
				joinApplicationSession.remove(sipApplicationSessionKey);
				found = true;
			}
		}
		it = replacesApplicationSession.values().iterator();
		found = false;
		while (it.hasNext() && !found) {
			MobicentsSipApplicationSessionKey sipApplicationSessionKey = it.next();
			if(sipApplicationSessionKey.equals(sipApplicationSession)) {
				replacesApplicationSession.remove(sipApplicationSessionKey);
				found = true;
			}
		}
	}
153807
@Override
	public void deleteSession(String sessionName) {
    	super.deleteSession(sessionName);
		logger.debug("deleteSession " + sessionName);

		deleteDbFile(new File(sessionName));
        deleteDbFile(new File(sessionName + ".data"));
        deleteDbFile(new File(sessionName + ".script"));
        deleteDbFile(new File(sessionName + ".properties"));
        deleteDbFile(new File(sessionName + ".backup"));
        deleteDbFile(new File(sessionName + ".lobs"));
    }
1059646
public void destorySession(Session session) {
        session.attributes().clear();
        sessionMap.remove(session.id());

        Event event = new Event();
        event.attribute("session", session);

        eventManager.fireEvent(EventType.SESSION_DESTROY, event);
    }
424673
private void removeSessionTicket(final String id) {
        val ticketId = TransientSessionTicketFactory.normalizeTicketId(id);
        this.ticketRegistry.deleteTicket(ticketId);
    }
143857
public void removeFromSession( HttpServletRequest request )
    {
        StorageHandler sh = Handlers.get( getServletContext() ).getStorageHandler();
        HttpServletRequest unwrappedRequest = PageFlowUtils.unwrapMultipart( request );
        RequestContext rc = new RequestContext( unwrappedRequest, null );
        String attrName =
                ScopedServletUtils.getScopedSessionAttrName( InternalConstants.FACES_BACKING_ATTR, unwrappedRequest );
        
        sh.removeAttribute( rc, attrName );
    }
967327
public static void clearSession(HttpServletRequest req) {
		SecurityContextHolder.clearContext();
		if (req != null) {
			HttpSession session = req.getSession(false);
			if (session != null) {
				session.invalidate();
			}
		}
	}
1337250
public static void removePrivateDataProvider(String elementName, String namespace) {
        String key = XmppStringUtils.generateKey(elementName, namespace);
        privateDataProviders.remove(key);
    }
390981
@Override
	public final void onSessionClosed(Session session) {
		this.hsClient.getConnector().removeSession(session);
		HandlerSocketSession hSession = (HandlerSocketSession) session;

		hSession.destroy();
		if (this.hsClient.getConnector().isStarted()
				&& hSession.isAllowReconnect()) {
			this.reconnect(session);
		}
		for (HSClientStateListener listener : this.hsClient
				.getHSClientStateListeners()) {
			listener.onDisconnected(this.hsClient, session
					.getRemoteSocketAddress());
		}
	}
276247
@Override
    public void removeSession(String id) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            String s = id + appNameForLogging;
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "removeSession", s);
        }
        Object removedEntry = _sessions.remove(id);
        if (removedEntry != null) {
            _storeCallback.sessionLiveCountDec(removedEntry);
        }
    }
978822
public void removeProvider(UserTransactionProvider provider)
   {
      UserTransactionProviderImpl impl = providers.get(provider);

      if (impl != null)
      {
         delegator.removeProvider(impl);
         providers.remove(provider);
      }
   }