org.apache.catalina.Manager.remove()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.apache.catalina.Manager.remove()方法的一些代码示例,展示了Manager.remove()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Manager.remove()方法的具体详情如下:
包路径:org.apache.catalina.Manager
类名称:Manager
方法名:remove

Manager.remove介绍

[英]Remove this Session from the active Sessions for this Manager.
[中]从此管理器的活动会话中删除此会话。

代码示例

代码示例来源:origin: redisson/redisson

@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
  String sessionId = request.getRequestedSessionId();
  Session session = request.getContext().getManager().findSession(sessionId);
  if (session != null) {
    if (!session.isValid()) {
      session.expire();
      request.getContext().getManager().remove(session);
    } else {
      manager.add(session);
      session.access();
      session.endAccess();
    }
  }
  
  try {
    getNext().invoke(request, response);
  } finally {
    manager.store(request.getSession(false));
  }
}

代码示例来源:origin: redisson/redisson

@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
  String sessionId = request.getRequestedSessionId();
  Session session = request.getContext().getManager().findSession(sessionId);
  if (session != null) {
    if (!session.isValid()) {
      session.expire();
      request.getContext().getManager().remove(session);
    } else {
      manager.add(session);
      session.access();
      session.endAccess();
    }
  }
  
  try {
    getNext().invoke(request, response);
  } finally {
    manager.store(request.getSession(false));
  }
}

代码示例来源:origin: redisson/redisson

@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
  String sessionId = request.getRequestedSessionId();
  Session session = request.getContext().getManager().findSession(sessionId);
  if (session != null) {
    if (!session.isValid()) {
      session.expire();
      request.getContext().getManager().remove(session);
    } else {
      manager.add(session);
      session.access();
      session.endAccess();
    }
  }
  
  try {
    getNext().invoke(request, response);
  } finally {
    manager.store(request.getSession(false));
  }
}

代码示例来源:origin: redisson/redisson

@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
  String sessionId = request.getRequestedSessionId();
  Session session = request.getContext().getManager().findSession(sessionId);
  if (session != null) {
    if (!session.isValid()) {
      session.expire();
      request.getContext().getManager().remove(session);
    } else {
      manager.add(session);
      session.access();
      session.endAccess();
    }
  }
  
  try {
    getNext().invoke(request, response);
  } finally {
    manager.store(request.getSession(false));
  }
}

代码示例来源:origin: magro/memcached-session-manager

/**
 * Set a new id for this session.<br/>
 * Before setting the new id, it removes itself from the associated
 * manager. After the new id is set, this session adds itself to the
 * session manager.
 *
 * @param id
 *            the new session id
 */
protected void setIdForRelocate( final String id ) {
  if ( this.id == null ) {
    throw new IllegalStateException( "There's no session id set." );
  }
  if ( this.manager == null ) {
    throw new IllegalStateException( "There's no manager set." );
  }
  /*
   * and mark it as a node-failure-session, so that remove(session) does
   * not try to remove it from memcached... (the session is removed and
   * added when the session id is changed)
   */
  setNote( MemcachedSessionService.NODE_FAILURE, Boolean.TRUE );
  manager.remove( this );
  removeNote( MemcachedSessionService.NODE_FAILURE );
  this.id = id;
  manager.add( this );
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * {@inheritDoc}
 */
@Override
public void setId(String id, boolean notify) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  if (notify) {
    tellNew();
  }
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Set the session identifier for this session.
 *
 * @param id The new session identifier
 */
public void setId(String id) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  tellNew();
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * {@inheritDoc}
 */
@Override
public void setId(String id, boolean notify) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  if (notify) {
    tellNew();
  }
}

代码示例来源:origin: tomcat/catalina

/**
 * Set the session identifier for this session.
 *
 * @param id The new session identifier
 */
public void setId(String id) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  tellNew();
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * {@inheritDoc}
 */
@Override
public void setId(String id, boolean notify) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  if (notify) {
    tellNew();
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Set the session identifier for this session.
 *
 * @param id The new session identifier
 */
@Override
public void setId(String id) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  tellNew();
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Set the session identifier for this session.
 *
 * @param id The new session identifier
 */
@Override
public void setId(String id) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  tellNew();
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * {@inheritDoc}
 */
@Override
public void setId(String id, boolean notify) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  if (notify) {
    tellNew();
  }
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Set the session identifier for this session.
 *
 * @param id The new session identifier
 */
@Override
public void setId(String id) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  tellNew();
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * {@inheritDoc}
 */
@Override
public void setId(String id, boolean notify) {
  if ((this.id != null) && (manager != null))
    manager.remove(this);
  this.id = id;
  if (manager != null)
    manager.add(this);
  if (notify) {
    tellNew();
  }
}

代码示例来源:origin: simplicityitself/Mongo-Tomcat-Sessions

@Override
public void setValid(boolean isValid) {
 this.isValid = isValid;
 if (!isValid) {
  String keys[] = keys();
  for (String key : keys) {
   removeAttributeInternal(key, false);
  }
  getManager().remove(this);
 }
}

代码示例来源:origin: de.javakaffee.msm/memcached-session-manager

/**
 * Set a new id for this session.<br/>
 * Before setting the new id, it removes itself from the associated
 * manager. After the new id is set, this session adds itself to the
 * session manager.
 *
 * @param id
 *            the new session id
 */
protected void setIdForRelocate( final String id ) {
  if ( this.id == null ) {
    throw new IllegalStateException( "There's no session id set." );
  }
  if ( this.manager == null ) {
    throw new IllegalStateException( "There's no manager set." );
  }
  /*
   * and mark it as a node-failure-session, so that remove(session) does
   * not try to remove it from memcached... (the session is removed and
   * added when the session id is changed)
   */
  setNote( MemcachedSessionService.NODE_FAILURE, Boolean.TRUE );
  manager.remove( this );
  removeNote( MemcachedSessionService.NODE_FAILURE );
  this.id = id;
  manager.add( this );
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Set the session identifier for this session.
 *
 * @param id The new session identifier
 */
public void setId(String id) {
  if ((this.id != null) && (manager != null))
      manager.remove(this);
  String oldId = this.id;
  this.id = id;
  if (manager != null)
    manager.add(this);
  if (oldId == null) {
    tellNew();
  } else {
    // Notify interested session event listeners
    fireSessionEvent(Session.SESSION_ID_CHANGED_EVENT, oldId);
  }
}

代码示例来源:origin: org.glassfish.main.web/web-core

manager.remove(this);

代码示例来源:origin: org.redisson/redisson-tomcat-8

@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
  String sessionId = request.getRequestedSessionId();
  Session session = request.getContext().getManager().findSession(sessionId);
  if (session != null) {
    if (!session.isValid()) {
      session.expire();
      request.getContext().getManager().remove(session);
    } else {
      manager.add(session);
      session.access();
      session.endAccess();
    }
  }
  
  try {
    getNext().invoke(request, response);
  } finally {
    manager.store(request.getSession(false));
  }
}

相关文章