Top Fields Constructors Methods
io.undertow.server.handlers.cache

public Class ResponseCachingSender

extends Object
implements Sender
Class Inheritance
All Implemented Interfaces
io.undertow.io.Sender
Imports
java.nio.ByteBuffer, java.nio.channels.FileChannel, java.nio.charset.Charset, .StandardCharsets, io.undertow.io.IoCallback, .Sender, org.xnio.Buffers

Author
Stuart Douglas

Field Summary

Modifier and TypeField and Description
private final DirectBufferCache.CacheEntry
private final Sender
private final long
private long

Constructor Summary

AccessConstructor and Description
public
ResponseCachingSender(final Sender delegate, final DirectBufferCache.CacheEntry cacheEntry, final long length)

Method Summary

Modifier and TypeMethod and Description
public void
close(final IoCallback
The callback that is notified when all data has been flushed and the channel is closed
callback
)

Implements io.undertow.io.Sender.close.

Closes this sender asynchronously.

public void
close()

Implements io.undertow.io.Sender.close.

Closes this sender asynchronously

private void
handleUpdate(final ByteBuffer origSrc)

private void
handleUpdate(final ByteBuffer[] origSrc, long totalWritten)

public void
send(final ByteBuffer
The buffer to send.
src
,
final IoCallback
The callback
callback
)

Implements io.undertow.io.Sender.send.

Write the given buffer using async IO, and calls the given callback on completion or error.

public void
send(final ByteBuffer[]
The buffers to send.
srcs
,
final IoCallback
The callback
callback
)

Implements io.undertow.io.Sender.send.

Write the given buffers using async IO, and calls the given callback on completion or error.

public void
send(final ByteBuffer
The buffer to send.
src
)

Implements io.undertow.io.Sender.send.

Write the given buffer using async IO, and ends the exchange when done

public void
send(final ByteBuffer[]
The buffers to send.
srcs
)

Implements io.undertow.io.Sender.send.

Write the given buffers using async IO, and ends the exchange when done

public void
send(final String
The data to send
data
,
final IoCallback
The callback
callback
)

Implements io.undertow.io.Sender.send.

Write the given String using async IO, and calls the given callback on completion or error.

public void
send(final String
The buffer to end.
data
,
final Charset
The charset to use
charset
,
final IoCallback
The callback
callback
)

Implements io.undertow.io.Sender.send.

Write the given String using async IO, and calls the given callback on completion or error.

public void
send(final String
The data to send
data
)

Implements io.undertow.io.Sender.send.

Write the given String using async IO, and ends the exchange when done

The CharSequence is encoded to UTF8

public void
send(final String
The buffer to end.
data
,
final Charset
The charset to use
charset
)

Implements io.undertow.io.Sender.send.

Write the given String using async IO, and ends the exchange when done

public void
transferFrom(FileChannel
the file channel to transfer
channel
,
IoCallback
The callback
callback
)

Implements io.undertow.io.Sender.transferFrom.

Transfers all content from the specified file

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheEntryback to summary
private final DirectBufferCache.CacheEntry cacheEntry
delegateback to summary
private final Sender delegate
lengthback to summary
private final long length
writtenback to summary
private long written

Constructor Detail

ResponseCachingSenderback to summary
public ResponseCachingSender(final Sender delegate, final DirectBufferCache.CacheEntry cacheEntry, final long length)

Method Detail

closeback to summary
public void close(final IoCallback callback)

Implements io.undertow.io.Sender.close.

Doc from io.undertow.io.Sender.close.

Closes this sender asynchronously. The given callback is notified on completion

Parameters
callback:IoCallback

The callback that is notified when all data has been flushed and the channel is closed

Annotations
@Override
closeback to summary
public void close()

Implements io.undertow.io.Sender.close.

Doc from io.undertow.io.Sender.close.

Closes this sender asynchronously

Annotations
@Override
handleUpdateback to summary
private void handleUpdate(final ByteBuffer origSrc)
handleUpdateback to summary
private void handleUpdate(final ByteBuffer[] origSrc, long totalWritten)
sendback to summary
public void send(final ByteBuffer src, final IoCallback callback)

Implements io.undertow.io.Sender.send.

Doc from io.undertow.io.Sender.send.

Write the given buffer using async IO, and calls the given callback on completion or error.

Parameters
src:ByteBuffer

The buffer to send.

callback:IoCallback

The callback

Annotations
@Override
sendback to summary
public void send(final ByteBuffer[] srcs, final IoCallback callback)

Implements io.undertow.io.Sender.send.

Doc from io.undertow.io.Sender.send.

Write the given buffers using async IO, and calls the given callback on completion or error.

Parameters
srcs:ByteBuffer[]

The buffers to send.

callback:IoCallback

The callback

Annotations
@Override
sendback to summary
public void send(final ByteBuffer src)

Implements io.undertow.io.Sender.send.

Doc from io.undertow.io.Sender.send.

Write the given buffer using async IO, and ends the exchange when done

Parameters
src:ByteBuffer

The buffer to send.

Annotations
@Override
sendback to summary
public void send(final ByteBuffer[] srcs)

Implements io.undertow.io.Sender.send.

Doc from io.undertow.io.Sender.send.

Write the given buffers using async IO, and ends the exchange when done

Parameters
srcs:ByteBuffer[]

The buffers to send.

Annotations
@Override
sendback to summary
public void send(final String data, final IoCallback callback)

Implements io.undertow.io.Sender.send.

Doc from io.undertow.io.Sender.send.

Write the given String using async IO, and calls the given callback on completion or error.

The CharSequence is encoded to UTF8

Parameters
data:String

The data to send

callback:IoCallback

The callback

Annotations
@Override
sendback to summary
public void send(final String data, final Charset charset, final IoCallback callback)

Implements io.undertow.io.Sender.send.

Doc from io.undertow.io.Sender.send.

Write the given String using async IO, and calls the given callback on completion or error.

Parameters
data:String

The buffer to end.

charset:Charset

The charset to use

callback:IoCallback

The callback

Annotations
@Override
sendback to summary
public void send(final String data)

Implements io.undertow.io.Sender.send.

Doc from io.undertow.io.Sender.send.

Write the given String using async IO, and ends the exchange when done

The CharSequence is encoded to UTF8

Parameters
data:String

The data to send

Annotations
@Override
sendback to summary
public void send(final String data, final Charset charset)

Implements io.undertow.io.Sender.send.

Doc from io.undertow.io.Sender.send.

Write the given String using async IO, and ends the exchange when done

Parameters
data:String

The buffer to end.

charset:Charset

The charset to use

Annotations
@Override
transferFromback to summary
public void transferFrom(FileChannel channel, IoCallback callback)

Implements io.undertow.io.Sender.transferFrom.

Doc from io.undertow.io.Sender.transferFrom.

Transfers all content from the specified file

Parameters
channel:FileChannel

the file channel to transfer

callback:IoCallback

The callback

Annotations
@Override