
org.simpleframework.transport.Flusher Maven / Gradle / Ivy
/*
* Flusher.java February 2007
*
* Copyright (C) 2007, Niall Gallagher
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.simpleframework.transport;
/**
* The Flusher
object is used to flush data to the
* underlying socket. This allows asynchronous writes to the socket
* to be managed in such a way that there is order to the way data
* is delivered over the socket. This uses a selector to dispatch
* flush invocations to the underlying socket when the socket is
* read ready. This allows the writing thread to continue without
* having to wait for all the data to be written to the socket.
*
* @author Niall Gallagher
*
* @see org.simpleframework.transport.Controller
*/
interface Flusher {
/**
* Here in this method we schedule a flush when the underlying
* writer is write ready. This allows the writer thread to return
* without having to fully flush the content to the underlying
* transport. To block the other flush method can be used.
*/
public void flush() throws Exception;
/**
* Here in this method we schedule a flush when the underlying
* writer is write ready. This allows the writer thread to return
* without having to fully flush the content to the underlying
* transport. To block this should invoked with true.
*
* @param block determines if the flush method should block
*/
public void flush(boolean block) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy