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 |
---|---|
Object |
getAttribute(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() |
SocketAddress |
getLocalAddress()
Returns the socket address of local machine which is associated with this
session.
|
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() |
Object |
setAttribute(Object key,
Object value)
Sets a user-defined attribute.
|
void |
suspend() |
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, doCloseImmediately
close, postClose
public 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)
IoSession
getAttribute
in interface IoSession
key
- the key of the attributepublic Object setAttribute(Object key, Object value)
IoSession
setAttribute
in interface IoSession
key
- the key of the attributevalue
- the value of the attributepublic SocketAddress getRemoteAddress()
IoSession
getRemoteAddress
in interface IoSession
public SocketAddress getLocalAddress()
IoSession
getLocalAddress
in interface IoSession
public long getId()
IoSession
public org.apache.mina.core.future.WriteFuture write(byte[] data, int offset, int len)
protected Closeable getInnerCloseable()
getInnerCloseable
in class CloseableUtils.AbstractInnerCloseable
public IoWriteFuture write(Buffer buffer)
IoSession
public IoService getService()
IoSession
getService
in interface IoSession
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.