com.sun.grizzly.nio.tmpselectors
Class TemporarySelectorWriter
java.lang.Object
com.sun.grizzly.AbstractWriter<SocketAddress>
com.sun.grizzly.nio.tmpselectors.TemporarySelectorWriter
- All Implemented Interfaces:
- Writer<SocketAddress>
- Direct Known Subclasses:
- TCPNIOTemporarySelectorWriter, UDPNIOTemporarySelectorWriter
public abstract class TemporarySelectorWriter
- extends AbstractWriter<SocketAddress>
- Author:
- oleksiys
|
Method Summary |
int |
getTimeout()
|
TemporarySelectorsEnabledTransport |
getTransport()
|
void |
setTimeout(int timeout)
|
Future<WriteResult<Buffer,SocketAddress>> |
write(Connection connection,
SocketAddress dstAddress,
Buffer buffer,
CompletionHandler<WriteResult<Buffer,SocketAddress>> completionHandler,
Interceptor<WriteResult> interceptor)
Method writes the buffer to the specific address. |
Future<WriteResult<Buffer,SocketAddress>> |
write(Connection connection,
SocketAddress dstAddress,
Buffer buffer,
CompletionHandler<WriteResult<Buffer,SocketAddress>> completionHandler,
Interceptor<WriteResult> interceptor,
long timeout,
TimeUnit timeunit)
Method writes the message to the specific address. |
protected int |
write0(Connection connection,
SocketAddress dstAddress,
Buffer buffer,
WriteResult currentResult,
long timeout,
TimeUnit timeunit)
Flush the buffer by looping until the Buffer is empty |
protected abstract int |
writeNow0(Connection connection,
SocketAddress dstAddress,
Buffer buffer,
WriteResult currentResult)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
transport
protected final TemporarySelectorsEnabledTransport transport
TemporarySelectorWriter
public TemporarySelectorWriter(TemporarySelectorsEnabledTransport transport)
getTimeout
public int getTimeout()
setTimeout
public void setTimeout(int timeout)
write
public Future<WriteResult<Buffer,SocketAddress>> write(Connection connection,
SocketAddress dstAddress,
Buffer buffer,
CompletionHandler<WriteResult<Buffer,SocketAddress>> completionHandler,
Interceptor<WriteResult> interceptor)
throws IOException
- Method writes the buffer to the specific address.
- Parameters:
connection - the Connection to write todstAddress - the destination address the buffer will be
sent tobuffer - the buffer, from which the data will be writtencompletionHandler - CompletionHandler,
which will get notified, when write will be completedinterceptor - Interceptor, which will be able to intercept
control each time new portion of a data was written from a
buffer.
The interceptor can decide, whether asynchronous write is
completed or not, or provide other processing instructions.
- Returns:
Future, using which it's possible to check the
result
- Throws:
IOException
write
public Future<WriteResult<Buffer,SocketAddress>> write(Connection connection,
SocketAddress dstAddress,
Buffer buffer,
CompletionHandler<WriteResult<Buffer,SocketAddress>> completionHandler,
Interceptor<WriteResult> interceptor,
long timeout,
TimeUnit timeunit)
throws IOException
- Method writes the message to the specific address.
- Parameters:
connection - the Connection to write todstAddress - the destination address the message will be
sent tomessage - the message, from which the data will be writtencompletionHandler - CompletionHandler,
which will get notified, when write will be completed
- Returns:
Future, using which it's possible to check the
result
- Throws:
IOException
write0
protected int write0(Connection connection,
SocketAddress dstAddress,
Buffer buffer,
WriteResult currentResult,
long timeout,
TimeUnit timeunit)
throws IOException
- Flush the buffer by looping until the
Buffer is empty
- Parameters:
channel - SelectableChannelbb - the Buffer to write.
- Returns:
- The number of bytes written
- Throws:
IOException
getTransport
public TemporarySelectorsEnabledTransport getTransport()
writeNow0
protected abstract int writeNow0(Connection connection,
SocketAddress dstAddress,
Buffer buffer,
WriteResult currentResult)
throws IOException
- Throws:
IOException
Copyright © 2009 SUN Microsystems. All Rights Reserved.