public class SessionTrackerImpl extends java.lang.Thread implements SessionTracker
Modifier and Type | Class and Description |
---|---|
static class |
SessionTrackerImpl.SessionImpl |
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
SessionTracker.Session, SessionTracker.SessionExpirer
Constructor and Description |
---|
SessionTrackerImpl(SessionTracker.SessionExpirer expirer,
java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Integer> sessionsWithTimeout,
int tickTime,
long sid) |
Modifier and Type | Method and Description |
---|---|
void |
addSession(long id,
int sessionTimeout) |
void |
checkSession(long sessionId,
java.lang.Object owner) |
long |
createSession(int sessionTimeout) |
void |
dumpSessions(java.io.PrintWriter pwriter)
Text dump of session information, suitable for debugging.
|
static long |
initializeNextSession(long id) |
void |
removeSession(long sessionId) |
void |
run() |
void |
setOwner(long id,
java.lang.Object owner) |
void |
setSessionClosing(long sessionId)
Mark that the session is in the process of closing.
|
void |
shutdown() |
java.lang.String |
toString() |
boolean |
touchSession(long sessionId,
int timeout) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
public SessionTrackerImpl(SessionTracker.SessionExpirer expirer, java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Integer> sessionsWithTimeout, int tickTime, long sid)
public static long initializeNextSession(long id)
public void dumpSessions(java.io.PrintWriter pwriter)
SessionTracker
dumpSessions
in interface SessionTracker
pwriter
- the output writerpublic java.lang.String toString()
toString
in class java.lang.Thread
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public boolean touchSession(long sessionId, int timeout)
touchSession
in interface SessionTracker
public void setSessionClosing(long sessionId)
SessionTracker
setSessionClosing
in interface SessionTracker
public void removeSession(long sessionId)
removeSession
in interface SessionTracker
public void shutdown()
shutdown
in interface SessionTracker
public long createSession(int sessionTimeout)
createSession
in interface SessionTracker
public void addSession(long id, int sessionTimeout)
addSession
in interface SessionTracker
public void checkSession(long sessionId, java.lang.Object owner) throws KeeperException.SessionExpiredException, KeeperException.SessionMovedException
checkSession
in interface SessionTracker
KeeperException.SessionExpiredException
KeeperException.SessionMovedException
public void setOwner(long id, java.lang.Object owner) throws KeeperException.SessionExpiredException
setOwner
in interface SessionTracker
KeeperException.SessionExpiredException
Copyright © 2015 The Apache Software Foundation