me.chanjar.weixin.common.session

## 类 StandardSession

- java.lang.Object
- - me.chanjar.weixin.common.session.StandardSession

所有已实现的接口:
  InternalSession, WxSession

    public class StandardSession
    extends Object
    implements WxSession, InternalSession

### 字段概要

字段
`protected AtomicInteger` `accessCount` The access count for this session.
`protected Map<String,Object>` `attributes`
`protected long` `creationTime` The time this session was created, in milliseconds since midnight, January 1, 1970 GMT.
`protected boolean` `expiring` We are currently processing a session expiration, so bypass certain IllegalStateException tests.
`protected StandardSessionFacade` `facade` The facade associated with this session.
`protected String` `id` The session identifier of this Session.
`protected boolean` `isValid` Flag indicating whether this session is valid or not.
`protected InternalSessionManager` `manager` The Manager with which this Session is associated.
`protected int` `maxInactiveInterval` The default maximum inactive interval for Sessions created by this Manager.
`protected static StringManager` `sm` The string manager for this package.
`protected long` `thisAccessedTime` The current accessed time for this session.

### 构造器概要

构造器
构造器和说明
`StandardSession(InternalSessionManager manager)`

### 方法概要

方法
`void` `access()` Update the accessed time information for this session.
`void` `endAccess()` End the access.
`boolean` `equals(Object o)`
`void` `expire()` Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.
`Object` `getAttribute(String name)`
`Enumeration<String>` `getAttributeNames()`
`String` `getIdInternal()` Return the session identifier for this session.
`WxSession` `getSession()` Return the `HttpSession` for which this object is the facade.
`int` `hashCode()`
`void` `invalidate()`
`boolean` `isValid()` Return the `isValid` flag for this session.
`protected boolean` `isValidInternal()` Return the `isValid` flag for this session without any expiration check.
`protected String[]` `keys()` Return the names of all currently defined session attributes as an array of Strings.
`void` `removeAttribute(String name)`
`protected void` `removeAttributeInternal(String name)`
`void` `setAttribute(String name, Object value)`
`void` `setCreationTime(long time)` Set the creation time for this session.
`void` `setId(String id)` Set the session identifier for this session.
`void` `setMaxInactiveInterval(int interval)` Set the default maximum inactive interval (in seconds) for Sessions created by this Manager.
`void` `setValid(boolean isValid)` Set the `isValid` flag for this session.

### 从类继承的方法 java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### 字段详细资料

#### sm

    protected static final StringManager sm

The string manager for this package.

#### attributes

    protected Map<String,Object> attributes

#### id

    protected String id

The session identifier of this Session.

#### isValid

    protected volatile boolean isValid

Flag indicating whether this session is valid or not.

#### expiring

    protected transient volatile boolean expiring

We are currently processing a session expiration, so bypass certain IllegalStateException tests. NOTE: This value is not included in the serialized version of this object.

#### manager

    protected transient InternalSessionManager manager

The Manager with which this Session is associated.

#### creationTime

    protected long creationTime

The time this session was created, in milliseconds since midnight, January 1, 1970 GMT.

#### thisAccessedTime

    protected volatile long thisAccessedTime

The current accessed time for this session.

#### maxInactiveInterval

    protected int maxInactiveInterval

The default maximum inactive interval for Sessions created by this Manager.

#### facade

    protected transient StandardSessionFacade facade

The facade associated with this session. NOTE: This value is not included in the serialized version of this object.

#### accessCount

    protected transient AtomicInteger accessCount

The access count for this session.

### 构造器详细资料

#### StandardSession

    public StandardSession(InternalSessionManager manager)

### 方法详细资料

#### getAttribute

    public Object getAttribute(String name)

指定者:
  `getAttribute` 在接口中 `WxSession`

#### getAttributeNames

    public Enumeration<String> getAttributeNames()

指定者:
  `getAttributeNames` 在接口中 `WxSession`

#### setAttribute

    public void setAttribute(String name,
                    Object value)

指定者:
  `setAttribute` 在接口中 `WxSession`

#### removeAttribute

    public void removeAttribute(String name)

指定者:
  `removeAttribute` 在接口中 `WxSession`

#### invalidate

    public void invalidate()

指定者:
  `invalidate` 在接口中 `WxSession`

#### getSession

    public WxSession getSession()

从接口复制的说明: `InternalSession`
Return the `HttpSession` for which this object is the facade.

指定者:
  `getSession` 在接口中 `InternalSession`

#### isValidInternal

    protected boolean isValidInternal()

Return the `isValid` flag for this session without any expiration check.

#### isValid

    public boolean isValid()

从接口复制的说明: `InternalSession`
Return the `isValid` flag for this session.

指定者:
  `isValid` 在接口中 `InternalSession`

#### setValid

    public void setValid(boolean isValid)

Set the `isValid` flag for this session.

指定者:
  `setValid` 在接口中 `InternalSession`
参数:
  `isValid` - The new value for the `isValid` flag

#### getIdInternal

    public String getIdInternal()

从接口复制的说明: `InternalSession`
Return the session identifier for this session.

指定者:
  `getIdInternal` 在接口中 `InternalSession`

#### removeAttributeInternal

    protected void removeAttributeInternal(String name)

#### expire

    public void expire()

从接口复制的说明: `InternalSession`
Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.

指定者:
  `expire` 在接口中 `InternalSession`

#### access

    public void access()

从接口复制的说明: `InternalSession`
Update the accessed time information for this session. This method should be called by the context when a request comes in for a particular session, even if the application does not reference it.

指定者:
  `access` 在接口中 `InternalSession`

#### endAccess

    public void endAccess()

从接口复制的说明: `InternalSession`
End the access.

指定者:
  `endAccess` 在接口中 `InternalSession`

#### setCreationTime

    public void setCreationTime(long time)

从接口复制的说明: `InternalSession`
Set the creation time for this session. This method is called by the Manager when an existing Session instance is reused.

指定者:
  `setCreationTime` 在接口中 `InternalSession`
参数:
  `time` - The new creation time

#### setMaxInactiveInterval

    public void setMaxInactiveInterval(int interval)

从接口复制的说明: `InternalSession`
Set the default maximum inactive interval (in seconds) for Sessions created by this Manager.

指定者:
  `setMaxInactiveInterval` 在接口中 `InternalSession`
参数:
  `interval` - The new default value

#### setId

    public void setId(String id)

从接口复制的说明: `InternalSession`
Set the session identifier for this session.

指定者:
  `setId` 在接口中 `InternalSession`
参数:
  `id` - The new session identifier

#### keys

    protected String[] keys()

Return the names of all currently defined session attributes as an array of Strings. If there are no defined attributes, a zero-length array is returned.

#### equals

    public boolean equals(Object o)

覆盖:
  `equals` 在类中 `Object`

#### hashCode

    public int hashCode()

覆盖:
  `hashCode` 在类中 `Object`