类 AbstractWebSession

java.lang.Object
cn.taketoday.session.AbstractWebSession
所有已实现的接口:
WebSession
直接已知子类:
InMemorySessionRepository.InMemoryWebSession, MapSession

public abstract class AbstractWebSession extends Object implements WebSession
Session events supported WebSession
从以下版本开始:
4.0 2022/10/30 15:43
作者:
Harry Yang
另请参阅:
  • 字段详细资料

    • attributes

      @Nullable protected Map<String,Object> attributes
      Map with String keys and Object values.
    • eventDispatcher

      protected final transient SessionEventDispatcher eventDispatcher
  • 构造器详细资料

  • 方法详细资料

    • setAttribute

      public void setAttribute(String name, @Nullable Object value)
      从接口复制的说明: WebSession
      Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.

      After this method executes, and if the new object implements AttributeBindingListener, the container calls AttributeBindingListener.valueBound. The container then notifies any HttpSessionAttributeListeners in the web application.

      If an object was already bound to this session of this name that implements AttributeBindingListener, its AttributeBindingListener.valueUnbound method is called.

      If the value passed in is null, this has the same effect as calling removeAttribute().

      指定者:
      setAttribute 在接口中 WebSession
      参数:
      name - the name to which the object is bound; cannot be null
      value - the object to be bound
    • attributeBinding

      protected boolean attributeBinding(Object value, @Nullable Object oldValue)
    • allowAttributeReplaced

      protected boolean allowAttributeReplaced(Object value, @Nullable Object oldValue)
    • attributeAdded

      protected void attributeAdded(String name, Object value)
    • attributeReplaced

      protected void attributeReplaced(String name, Object oldValue, Object value)
    • attributeRemoved

      protected void attributeRemoved(String name, Object attribute)
    • getAttribute

      @Nullable public Object getAttribute(String name)
      从接口复制的说明: WebSession
      Returns the object bound with the specified name in this session, or null if no object is bound under the name.
      指定者:
      getAttribute 在接口中 WebSession
      参数:
      name - a string specifying the name of the object
      返回:
      the object with the specified name
    • removeAttribute

      public Object removeAttribute(String name)
      从接口复制的说明: WebSession
      Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.

      After this method executes, and if the object implements AttributeBindingListener, the container calls AttributeBindingListener.valueUnbound . The container then notifies any WebSessionAttributeListeners in the web application.

      指定者:
      removeAttribute 在接口中 WebSession
      参数:
      name - the name of the object to remove from this session
    • invalidate

      public void invalidate()
      从接口复制的说明: WebSession
      Invalidate the current session and clear session storage.
      指定者:
      invalidate 在接口中 WebSession
    • doInvalidate

      protected void doInvalidate()
    • hasAttribute

      public boolean hasAttribute(String name)
      从接口复制的说明: WebSession
      Return true if the attribute identified by name exists. Otherwise return false.
      指定者:
      hasAttribute 在接口中 WebSession
      参数:
      name - the unique attribute key
    • getAttributeNames

      public String[] getAttributeNames()
      从接口复制的说明: WebSession
      Return the names of all attributes.
      指定者:
      getAttributeNames 在接口中 WebSession
    • attributeNames

      public Iterator<String> attributeNames()
      从接口复制的说明: WebSession
      Return the names Iterator.
      指定者:
      attributeNames 在接口中 WebSession
    • copyAttributesFrom

      protected final void copyAttributesFrom(WebSession source)
      Copy the attributes from the supplied AttributeAccessor to this accessor.
      参数:
      source - the AttributeAccessor to copy from
    • hasAttributes

      public boolean hasAttributes()
      Returns true if this map contains no key-value mappings.
      指定者:
      hasAttributes 在接口中 WebSession
      返回:
      true if this map contains no key-value mappings
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • getAttributes

      public Map<String,Object> getAttributes()
      从接口复制的说明: WebSession
      Return attributes map
      指定者:
      getAttributes 在接口中 WebSession
      返回:
      attributes map
    • createAttributes

      protected Map<String,Object> createAttributes()