public class Sessions
extends java.lang.Object
Session
.Modifier and Type | Field and Description |
---|---|
protected static int |
_cnt |
protected static java.lang.ThreadLocal<java.lang.Object> |
_sess
Used to the store the session for the current thread.
|
Modifier | Constructor and Description |
---|---|
protected |
Sessions() |
Modifier and Type | Method and Description |
---|---|
static int |
getCount()
Returns the number of total alive session.
|
static Session |
getCurrent()
Returns the session for the current thread, or null if not available.
|
static Session |
getCurrent(boolean create)
Returns the session for the current thread, or null if not available.
|
protected static final java.lang.ThreadLocal<java.lang.Object> _sess
protected static int _cnt
public static final int getCount()
public static final Session getCurrent()
Note: it returns null if it is called in a working thread.
public static final Session getCurrent(boolean create)
create
- whether to create a new session if not available.
Notice that this method might return null if it is called in
a working thread, even though create is true,Copyright © 2005-2023 Potix Corporation. All Rights Reserved.