public class MinaSession extends CloseableUtils.AbstractInnerCloseable implements IoSession
CLOSED, closeFuture, GRACEFUL, IMMEDIATE, lock, log, OPENED, state| Constructor and Description |
|---|
MinaSession(MinaService service,
org.apache.mina.core.session.IoSession session) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getAttribute(java.lang.Object key)
Returns the value of the user-defined attribute of this session.
|
long |
getId()
Returns a unique identifier for this session.
|
protected Closeable |
getInnerCloseable() |
java.net.SocketAddress |
getLocalAddress()
Returns the socket address of local machine which is associated with this
session.
|
java.net.SocketAddress |
getRemoteAddress()
Returns the socket address of remote peer.
|
IoService |
getService()
Returns the IoService that created this session.
|
org.apache.mina.core.session.IoSession |
getSession() |
java.lang.Object |
setAttribute(java.lang.Object key,
java.lang.Object value)
Sets a user-defined attribute.
|
void |
suspend() |
java.lang.String |
toString() |
IoWriteFuture |
write(Buffer buffer)
Write a packet on the socket.
|
org.apache.mina.core.future.WriteFuture |
write(byte[] data,
int offset,
int len) |
doCloseGracefully, doCloseImmediatelyclose, postClosepublic MinaSession(MinaService service, org.apache.mina.core.session.IoSession session)
public org.apache.mina.core.session.IoSession getSession()
public void suspend()
public java.lang.Object getAttribute(java.lang.Object key)
IoSessiongetAttribute in interface IoSessionkey - the key of the attributepublic java.lang.Object setAttribute(java.lang.Object key,
java.lang.Object value)
IoSessionsetAttribute in interface IoSessionkey - the key of the attributevalue - the value of the attributepublic java.net.SocketAddress getRemoteAddress()
IoSessiongetRemoteAddress in interface IoSessionpublic java.net.SocketAddress getLocalAddress()
IoSessiongetLocalAddress in interface IoSessionpublic long getId()
IoSessionpublic org.apache.mina.core.future.WriteFuture write(byte[] data,
int offset,
int len)
protected Closeable getInnerCloseable()
getInnerCloseable in class CloseableUtils.AbstractInnerCloseablepublic IoWriteFuture write(Buffer buffer)
IoSessionpublic IoService getService()
IoSessiongetService in interface IoSessionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008-2014 The Apache Software Foundation. All Rights Reserved.