public class MinaSession extends AbstractInnerCloseable implements IoSession
| Modifier and Type | Class and Description |
|---|---|
static class |
MinaSession.Future |
AbstractCloseable.StatecloseFuture, lock, statelogCLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Constructor and Description |
|---|
MinaSession(MinaService service,
org.apache.mina.core.session.IoSession session) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(Object key)
Returns the value of the user-defined attribute of this session.
|
long |
getId() |
protected Closeable |
getInnerCloseable() |
SocketAddress |
getLocalAddress() |
SocketAddress |
getRemoteAddress() |
IoService |
getService() |
org.apache.mina.core.session.IoSession |
getSession() |
Object |
setAttribute(Object key,
Object value)
Sets a user-defined attribute.
|
void |
suspend() |
String |
toString() |
IoWriteFuture |
write(byte[] data) |
IoWriteFuture |
write(byte[] data,
int offset,
int len) |
IoWriteFuture |
write(org.apache.mina.core.buffer.IoBuffer buffer) |
IoWriteFuture |
writePacket(Buffer buffer)
Encode and send the given buffer.
|
doCloseGracefully, doCloseImmediatelyaddCloseFutureListener, builder, close, isClosed, isClosing, preClose, removeCloseFutureListenergetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenerpublic MinaSession(MinaService service, org.apache.mina.core.session.IoSession session)
public org.apache.mina.core.session.IoSession getSession()
public void suspend()
public Object getAttribute(Object key)
IoSessiongetAttribute in interface IoSessionkey - the key of the attributepublic Object setAttribute(Object key, Object value)
IoSessionsetAttribute in interface IoSessionkey - the key of the attributevalue - the value of the attributepublic SocketAddress getRemoteAddress()
getRemoteAddress in interface IoSessionpublic SocketAddress getLocalAddress()
getLocalAddress in interface IoSessionpublic long getId()
protected Closeable getInnerCloseable()
getInnerCloseable in class AbstractInnerCloseablepublic IoWriteFuture write(byte[] data)
public IoWriteFuture write(byte[] data, int offset, int len)
public IoWriteFuture writePacket(Buffer buffer)
PacketWriterwritePacket in interface PacketWriterbuffer - the buffer to encode and send. NOTE: the buffer must not be touched
until the returned write future is completed.IoWriteFuture that can be used to check when the packet has actually been sentpublic IoWriteFuture write(org.apache.mina.core.buffer.IoBuffer buffer)
public IoService getService()
getService in interface IoSessionIoService that created this session.Copyright © 2008–2018 The Apache Software Foundation. All rights reserved.