Class DefaultIoSessionDataStructureFactory.DefaultWriteRequestQueue
java.lang.Object
org.apache.mina.core.session.DefaultIoSessionDataStructureFactory.DefaultWriteRequestQueue
- All Implemented Interfaces:
WriteRequestQueue
- Enclosing class:
DefaultIoSessionDataStructureFactory
private static class DefaultIoSessionDataStructureFactory.DefaultWriteRequestQueue
extends Object
implements WriteRequestQueue
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Queue<WriteRequest> A queue to store incoming write requests -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all the requests from this session's queue.voidDisposes any releases associated with the specified session.booleanTells if the WriteRequest queue is empty or not for a sessionvoidoffer(IoSession session, WriteRequest writeRequest) Add a new WriteRequest to the session write's queueGet the first request available in the queue for a session.intsize()toString()
-
Field Details
-
q
A queue to store incoming write requests
-
-
Constructor Details
-
DefaultWriteRequestQueue
private DefaultWriteRequestQueue()
-
-
Method Details
-
dispose
Disposes any releases associated with the specified session. This method is invoked on disconnection.- Specified by:
disposein interfaceWriteRequestQueue- Parameters:
session- The associated session
-
clear
Removes all the requests from this session's queue.- Specified by:
clearin interfaceWriteRequestQueue- Parameters:
session- The associated session
-
isEmpty
Tells if the WriteRequest queue is empty or not for a session- Specified by:
isEmptyin interfaceWriteRequestQueue- Parameters:
session- The session to check- Returns:
trueif the writeRequest is empty
-
offer
Add a new WriteRequest to the session write's queue- Specified by:
offerin interfaceWriteRequestQueue- Parameters:
session- The sessionwriteRequest- The writeRequest to add
-
poll
Get the first request available in the queue for a session.- Specified by:
pollin interfaceWriteRequestQueue- Parameters:
session- The session- Returns:
- The first available request, if any.
-
toString
-
size
public int size()- Specified by:
sizein interfaceWriteRequestQueue- Returns:
- the number of objects currently stored in the queue.
-