1/*2 * Licensed to the Apache Software Foundation (ASF) under one3 * or more contributor license agreements. See the NOTICE file4 * distributed with this work for additional information5 * regarding copyright ownership. The ASF licenses this file6 * to you under the Apache License, Version 2.0 (the7 * "License"); you may not use this file except in compliance8 * with the License. You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing,13 * software distributed under the License is distributed on an14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY15 * KIND, either express or implied. See the License for the16 * specific language governing permissions and limitations17 * under the License.18 *19 */20package org.apache.mina.core.write;
2122import org.apache.mina.core.session.IoSession;
2324/**25 * Stores {@link WriteRequest}s which are queued to an {@link IoSession}.26 * 27 * @author <a href="http://mina.apache.org">Apache MINA Project</a>28 */29publicinterfaceWriteRequestQueue {
3031/**32 * Get the first request available in the queue for a session.33 * @param session The session34 * @return The first available request, if any.35 */36WriteRequest poll(IoSession session);
3738/**39 * Add a new WriteRequest to the session write's queue40 * @param session The session41 * @param writeRequest The writeRequest to add42 */43void offer(IoSession session, WriteRequest writeRequest);
4445/**46 * Tells if the WriteRequest queue is empty or not for a session47 * @param session The session to check48 * @return <tt>true</tt> if the writeRequest is empty49 */50boolean isEmpty(IoSession session);
5152/**53 * Removes all the requests from this session's queue.54 * @param session The associated session55 */56void clear(IoSession session);
5758/**59 * Disposes any releases associated with the specified session.60 * This method is invoked on disconnection.61 * @param session The associated session62 */63void dispose(IoSession session);
6465/**66 * @return the number of objects currently stored in the queue.67 */68int size();
69 }