Package org.glassfish.grizzly
Interface OutputSink
-
- All Known Subinterfaces:
Connection<L>,Writeable<L>
- All Known Implementing Classes:
NIOConnection,TCPNIOConnection,TCPNIOServerConnection,UDPNIOConnection,UDPNIOServerConnection
public interface OutputSinkThis interface defines methods to allow an
OutputStreamorWriterto allow the developer to check with the runtime whether or not it's possible to write a certain amount of data, or if it's not possible, to be notified when it is.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleancanWrite()booleancanWrite(int length)Deprecated.thelengthparameter will be ignored.voidnotifyCanWrite(WriteHandler handler)Instructs theOutputSinkto invoke the providedWriteHandlerwhen it is possible to write more bytes (or characters).voidnotifyCanWrite(WriteHandler handler, int length)Deprecated.thelengthparameter will be ignored.
-
-
-
Method Detail
-
notifyCanWrite
void notifyCanWrite(WriteHandler handler)
Instructs theOutputSinkto invoke the providedWriteHandlerwhen it is possible to write more bytes (or characters). Note that once theWriteHandlerhas been notified, it will not be considered for notification again at a later point in time.- Parameters:
handler- theWriteHandlerthat should be notified when it's possible to write more data.- Throws:
IllegalStateException- if this method is invoked and a handler from a previous invocation is still present (due to not having yet been notified).- Since:
- 2.3
-
notifyCanWrite
@Deprecated void notifyCanWrite(WriteHandler handler, int length)
Deprecated.thelengthparameter will be ignored. Pls. usenotifyCanWrite(org.glassfish.grizzly.WriteHandler).Instructs theOutputSinkto invoke the providedWriteHandlerwhen it is possible to writelengthbytes (or characters). Note that once theWriteHandlerhas been notified, it will not be considered for notification again at a later point in time.- Parameters:
handler- theWriteHandlerthat should be notified when it's possible to writelengthbytes.length- the number of bytes or characters that require writing.- Throws:
IllegalStateException- if this method is invoked and a handler from a previous invocation is still present (due to not having yet been notified).
-
canWrite
boolean canWrite()
- Returns:
trueif a write to thisOutputSinkwill succeed, otherwise returnsfalse.- Since:
- 2.3
-
canWrite
@Deprecated boolean canWrite(int length)
Deprecated.thelengthparameter will be ignored. Pls. usecanWrite().- Parameters:
length- specifies the number of bytes (or characters) that require writing- Returns:
trueif a write to thisOutputSinkwill succeed, otherwise returnsfalse.
-
-