private static class ProxyRequestHandler.ProxyContentChannel extends Object implements ContentChannel
Modifier and Type | Field and Description |
---|---|
(package private) ContentChannel |
delegate |
(package private) SharedResource |
request |
(package private) ResourceReference |
requestReference |
Constructor and Description |
---|
ProxyContentChannel(SharedResource request,
ContentChannel delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close(CompletionHandler completionHandler)
Closes this ContentChannel.
|
String |
toString() |
void |
write(ByteBuffer buf,
CompletionHandler completionHandler)
Schedules the given
ByteBuffer to be written to the content corresponding to this ContentChannel. |
final SharedResource request
final ResourceReference requestReference
final ContentChannel delegate
ProxyContentChannel(SharedResource request, ContentChannel delegate)
public void write(ByteBuffer buf, CompletionHandler completionHandler)
ContentChannel
ByteBuffer
to be written to the content corresponding to this ContentChannel. This
call transfers ownership of the given ByteBuffer to this ContentChannel, i.e. no further calls can be
made to the buffer. The execution of writes happen in the same order as this method was invoked.write
in interface ContentChannel
buf
- The ByteBuffer
to schedule for write. No further calls can be made to this buffer.completionHandler
- The CompletionHandler
to call after the write has been executed.public void close(CompletionHandler completionHandler)
ContentChannel
ContentChannel.write(ByteBuffer,
CompletionHandler)
upon it will cause an IllegalStateException
to be thrown. If this channel is already
closed then invoking this method has no effect, but CompletionHandler.completed()
will still be called.
Notice that you MUST call this method, regardless of any exceptions that might have occurred while writing to this
ContentChannel. Failure to do so will prevent the Container
from ever shutting down.close
in interface ContentChannel
completionHandler
- The CompletionHandler
to call after the close has been executed.Copyright © 2017. All rights reserved.