public class Session extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
Session.ArrayQueueItem |
static class |
Session.QueueItem |
| Modifier and Type | Field and Description |
|---|---|
static int |
ACTIVE |
protected boolean |
closing |
static int |
CLOSING |
static int |
EVENT_MASK |
protected int |
events |
protected int |
eventsToListen |
static int |
IDLE |
protected long |
lastAccessTime |
protected static org.apache.commons.logging.Log |
log |
protected Session.QueueItem |
queueHead |
static int |
READABLE |
protected Selector |
selector |
protected int |
slot |
protected Socket |
socket |
static int |
SSL |
static int |
STALE |
protected boolean |
wasSelected |
static int |
WRITEABLE |
| Constructor and Description |
|---|
Session(Socket socket) |
Session(Socket socket,
int eventsToListen) |
| Modifier and Type | Method and Description |
|---|---|
int |
checkStatus(long currentTime,
long keepAlive) |
void |
close() |
void |
getQueueStats(long[] stats) |
String |
getRemoteHost() |
void |
handleException(Throwable e) |
boolean |
isSsl() |
long |
lastAccessTime() |
void |
listen(int newEventsToListen) |
void |
process(byte[] buffer) |
protected void |
processRead(byte[] buffer) |
protected void |
processWrite() |
int |
read(byte[] data,
int offset,
int count) |
int |
readRaw(long address,
int count) |
void |
scheduleClose() |
Socket |
socket() |
void |
write(byte[] data,
int offset,
int count) |
void |
write(byte[] data,
int offset,
int count,
int flags) |
void |
write(Session.QueueItem item) |
protected static final org.apache.commons.logging.Log log
public static final int READABLE
public static final int WRITEABLE
public static final int CLOSING
public static final int EVENT_MASK
public static final int SSL
public static final int ACTIVE
public static final int IDLE
public static final int STALE
protected Socket socket
protected Selector selector
protected int slot
protected int events
protected int eventsToListen
protected boolean wasSelected
protected boolean closing
protected Session.QueueItem queueHead
protected volatile long lastAccessTime
public Session(Socket socket)
public Session(Socket socket, int eventsToListen)
public final String getRemoteHost()
public final Socket socket()
public final long lastAccessTime()
public boolean isSsl()
public int checkStatus(long currentTime,
long keepAlive)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic void scheduleClose()
public void getQueueStats(long[] stats)
public void listen(int newEventsToListen)
public int read(byte[] data,
int offset,
int count)
throws IOException
IOExceptionpublic int readRaw(long address,
int count)
throws IOException
IOExceptionpublic final void write(byte[] data,
int offset,
int count)
throws IOException
IOExceptionpublic final void write(byte[] data,
int offset,
int count,
int flags)
throws IOException
IOExceptionpublic final void write(Session.QueueItem item) throws IOException
IOExceptionpublic void handleException(Throwable e)
Copyright © 2019. All rights reserved.