Top Inners Fields Constructors Methods
org.eclipse.jetty.server.handler

public Class StatisticsHandler

extends EventsHandler
Class Inheritance
Known Direct Subclasses
org.eclipse.jetty.server.handler.StatisticsHandler.MinimumDataRateHandler
Imports
java.io.IOException, java.nio.ByteBuffer, java.time.Duration, java.util.concurrent.TimeoutException, java.util.concurrent.atomic.LongAdder, org.eclipse.jetty.http.HttpFields, org.eclipse.jetty.io.Content, org.eclipse.jetty.server.Handler, .Request, .Response, org.eclipse.jetty.util.BufferUtil, .Callback, .NanoTime, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedOperation, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.statistic.CounterStatistic, .SampleStatistic

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
StatisticsHandler.MinimumDataRateHandler

Checks that the wrapped handler can read/write at a minimal rate of N bytes per second.

Field Summary

Modifier and TypeField and Description
private final LongAdder
private final LongAdder
private final LongAdder
private final CounterStatistic
private final SampleStatistic
private final LongAdder
private final CounterStatistic
private final SampleStatistic
private final LongAdder
private final LongAdder
private final LongAdder
private final LongAdder
private final LongAdder
private long

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected void
doStart()

Overrides org.eclipse.jetty.server.Handler.Abstract.doStart.

Starts the managed lifecycle beans in the order they were added.

public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.dump.

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public long
public long
public int
public int
public int
public long
public double
public double
public long
public int
public int
public int
getRequests()
Deprecated use getRequestTotal() instead.

public int
public int
public long
public double
public double
public long
public int
public int
public int
public int
public int
public int
public Duration
protected void
onAfterHandling(Request
the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.
request
,
boolean
if the server handlers handled the request
handled
,
Throwable
the exception thrown by the application
failure
)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onAfterHandling.

Invoked after application handling (i.e. just after the call to the Runnable returned from org.eclipse.jetty.server.HttpChannel#onRequest(MetaData.Request) returns).

protected void
onBeforeHandling(Request
the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.
request
)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onBeforeHandling.

Invoked just before calling the server handler tree (i.e. just before the Runnable returned from org.eclipse.jetty.server.HttpChannel#onRequest(MetaData.Request) is run).

protected void
onComplete(Request
the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.
request
,
Throwable
if there was a failure to complete
failure
)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onComplete.

Invoked when the request and response processing are complete, just before the request and response will be recycled (i.e. after the Runnable return from org.eclipse.jetty.server.HttpChannel#onRequest(MetaData.Request) has returned and the Callback passed to Handler#handle(Request, Response, Callback) has been completed).

protected void
onRequestRead(Request
the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.
request
,
Content.Chunk
a potentially null request content chunk, including error and org.eclipse.jetty.http.Trailers chunks. If a reference to the chunk (or its ByteBuffer) is kept, then Content.Chunk#retain() must be called.
chunk
)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onRequestRead.

Invoked every time a request content chunk has been parsed, just before making it available to the application (i.e. from within a call to Request#read()).

protected void
onResponseBegin(Request
the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.
request
,
int
the response status
status
,
HttpFields
the immutable fields of the response object
headers
)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onResponseBegin.

Invoked just before the response is line written to the network (i.e. from within the first call to Response#write(boolean, ByteBuffer, Callback)).

protected void
onResponseWrite(Request
the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.
request
,
boolean
indicating last write
last
,
ByteBuffer
The ByteBuffer of the response content chunk (readonly).
content
)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onResponseWrite.

Invoked before each response content chunk has been written (i.e. from within the any call to Response#write(boolean, ByteBuffer, Callback)).

public void
Inherited from org.eclipse.jetty.server.handler.EventsHandler:
handleonResponseTrailersCompleteonResponseWriteComplete

Field Detail

_bytesReadback to summary
private final LongAdder _bytesRead
_bytesWrittenback to summary
private final LongAdder _bytesWritten
_failuresback to summary
private final LongAdder _failures
_handleStatsback to summary
private final CounterStatistic _handleStats
_handleTimeStatsback to summary
private final SampleStatistic _handleTimeStats
_handlingFailuresback to summary
private final LongAdder _handlingFailures
_requestStatsback to summary
private final CounterStatistic _requestStats
_requestTimeStatsback to summary
private final SampleStatistic _requestTimeStats
_responses1xxback to summary
private final LongAdder _responses1xx
_responses2xxback to summary
private final LongAdder _responses2xx
_responses3xxback to summary
private final LongAdder _responses3xx
_responses4xxback to summary
private final LongAdder _responses4xx
_responses5xxback to summary
private final LongAdder _responses5xx
_startTimeback to summary
private long _startTime

Constructor Detail

StatisticsHandlerback to summary
public StatisticsHandler()
StatisticsHandlerback to summary
public StatisticsHandler(Handler handler)

Method Detail

doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.server.Handler.Abstract.doStart.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

If there was a problem starting. Will cause a transition to FAILED state

dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.dump.

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.

Parameters
out:Appendable

The appendable to dump to

indent:String

The indent to apply after any new lines.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
getBytesReadback to summary
public long getBytesRead()
Annotations
@ManagedAttribute:bytes read count
getBytesWrittenback to summary
public long getBytesWritten()
Annotations
@ManagedAttribute:bytes written count
getFailuresback to summary
public int getFailures()
Annotations
@ManagedAttribute:number of failed requests
getHandleActiveback to summary
public int getHandleActive()
Annotations
@ManagedAttribute:current number of requests in handle()
getHandleActiveMaxback to summary
public int getHandleActiveMax()
Annotations
@ManagedAttribute:maximum number of requests in handle()
getHandleTimeMaxback to summary
public long getHandleTimeMax()
Annotations
@ManagedAttribute:maximum handle() execution time (in ns)
getHandleTimeMeanback to summary
public double getHandleTimeMean()
Annotations
@ManagedAttribute:mean handle() execution time (in ns)
getHandleTimeStdDevback to summary
public double getHandleTimeStdDev()
Annotations
@ManagedAttribute:standard deviation for handle() execution time (in ns)
getHandleTimeTotalback to summary
public long getHandleTimeTotal()
Annotations
@ManagedAttribute:total time spent in handle() execution (in ns)
getHandleTotalback to summary
public int getHandleTotal()
Annotations
@ManagedAttribute:total number of calls to handle()
getHandlingFailuresback to summary
public int getHandlingFailures()
Annotations
@ManagedAttribute:number of requests that threw an exception from handle()
getRequestsback to summary
public int getRequests()

Deprecated

use getRequestTotal() instead.

Annotations
@Deprecated
@ManagedAttribute:number of requests
getRequestsActiveback to summary
public int getRequestsActive()
Annotations
@ManagedAttribute:current number of active requests
getRequestsActiveMaxback to summary
public int getRequestsActiveMax()
Annotations
@ManagedAttribute:maximum number of active requests
getRequestTimeMaxback to summary
public long getRequestTimeMax()
Annotations
@ManagedAttribute:maximum request execution time (in ns)
getRequestTimeMeanback to summary
public double getRequestTimeMean()
Annotations
@ManagedAttribute:mean request execution time (in ns)
getRequestTimeStdDevback to summary
public double getRequestTimeStdDev()
Annotations
@ManagedAttribute:standard deviation for request execution time (in ns)
getRequestTimeTotalback to summary
public long getRequestTimeTotal()
Annotations
@ManagedAttribute:total time spent in request execution (in ns)
getRequestTotalback to summary
public int getRequestTotal()
Annotations
@ManagedAttribute:total number of requests
getResponses1xxback to summary
public int getResponses1xx()
Annotations
@ManagedAttribute:number of requests with 1xx response status
getResponses2xxback to summary
public int getResponses2xx()
Annotations
@ManagedAttribute:number of requests with 2xx response status
getResponses3xxback to summary
public int getResponses3xx()
Annotations
@ManagedAttribute:number of requests with 3xx response status
getResponses4xxback to summary
public int getResponses4xx()
Annotations
@ManagedAttribute:number of requests with 4xx response status
getResponses5xxback to summary
public int getResponses5xx()
Annotations
@ManagedAttribute:number of requests with 5xx response status
getStatisticsDurationback to summary
public Duration getStatisticsDuration()
Annotations
@ManagedAttribute:duration for which statistics have been collected
onAfterHandlingback to summary
protected void onAfterHandling(Request request, boolean handled, Throwable failure)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onAfterHandling.

Doc from org.eclipse.jetty.server.handler.EventsHandler.onAfterHandling.

Invoked after application handling (i.e. just after the call to the Runnable returned from org.eclipse.jetty.server.HttpChannel#onRequest(MetaData.Request) returns).

Parameters
request:Request

the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.

handled:boolean

if the server handlers handled the request

failure:Throwable

the exception thrown by the application

Annotations
@Override
onBeforeHandlingback to summary
protected void onBeforeHandling(Request request)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onBeforeHandling.

Doc from org.eclipse.jetty.server.handler.EventsHandler.onBeforeHandling.

Invoked just before calling the server handler tree (i.e. just before the Runnable returned from org.eclipse.jetty.server.HttpChannel#onRequest(MetaData.Request) is run).

This is the final state of the request before the handlers are called. This includes any request customization.

Parameters
request:Request

the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.

Annotations
@Override
onCompleteback to summary
protected void onComplete(Request request, Throwable failure)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onComplete.

Doc from org.eclipse.jetty.server.handler.EventsHandler.onComplete.

Invoked when the request and response processing are complete, just before the request and response will be recycled (i.e. after the Runnable return from org.eclipse.jetty.server.HttpChannel#onRequest(MetaData.Request) has returned and the Callback passed to Handler#handle(Request, Response, Callback) has been completed).

Parameters
request:Request

the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.

failure:Throwable

if there was a failure to complete

Annotations
@Override
onRequestReadback to summary
protected void onRequestRead(Request request, Content.Chunk chunk)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onRequestRead.

Doc from org.eclipse.jetty.server.handler.EventsHandler.onRequestRead.

Invoked every time a request content chunk has been parsed, just before making it available to the application (i.e. from within a call to Request#read()).

Parameters
request:Request

the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.

chunk:Content.Chunk

a potentially null request content chunk, including error and org.eclipse.jetty.http.Trailers chunks. If a reference to the chunk (or its ByteBuffer) is kept, then Content.Chunk#retain() must be called.

Annotations
@Override
onResponseBeginback to summary
protected void onResponseBegin(Request request, int status, HttpFields headers)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onResponseBegin.

Doc from org.eclipse.jetty.server.handler.EventsHandler.onResponseBegin.

Invoked just before the response is line written to the network (i.e. from within the first call to Response#write(boolean, ByteBuffer, Callback)).

Parameters
request:Request

the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.

status:int

the response status

headers:HttpFields

the immutable fields of the response object

Annotations
@Override
onResponseWriteback to summary
protected void onResponseWrite(Request request, boolean last, ByteBuffer content)

Overrides org.eclipse.jetty.server.handler.EventsHandler.onResponseWrite.

Doc from org.eclipse.jetty.server.handler.EventsHandler.onResponseWrite.

Invoked before each response content chunk has been written (i.e. from within the any call to Response#write(boolean, ByteBuffer, Callback)).

Parameters
request:Request

the request object. The read(), demand(Runnable) and fail(Throwable) methods must not be called by the listener.

last:boolean

indicating last write

content:ByteBuffer

The ByteBuffer of the response content chunk (readonly).

Annotations
@Override
resetback to summary
public void reset()
Annotations
@ManagedOperation:resets the statistics
impact:ACTION
org.eclipse.jetty.server.handler back to summary

public Class StatisticsHandler.MinimumDataRateHandler

extends StatisticsHandler
Class Inheritance

Checks that the wrapped handler can read/write at a minimal rate of N bytes per second. When reading or writing does not conform to the specified rates, this handler prevents further reads or writes by making them immediately fail.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
protected class

Field Summary

Modifier and TypeField and Description
private final long
private final long

Constructor Summary

AccessConstructor and Description
public
MinimumDataRateHandler(long
the minimum number of bytes to be read per second, or 0 for not checking the read rate.
minimumReadRate
,
long
the minimum number of bytes to be written per second, or 0 for not checking the write rate.
minimumWriteRate
)

Creates a MinimumDataRateHandler with the specified read and write rates.

public
MinimumDataRateHandler(Handler
the handler to wrap.
handler
,
long
the minimum number of bytes to be read per second, or 0 for not checking the read rate.
minimumReadRate
,
long
the minimum number of bytes to be written per second, or 0 for not checking the write rate.
minimumWriteRate
)

Creates a MinimumDataRateHandler with the specified read and write rates.

Method Summary

Modifier and TypeMethod and Description
public boolean
handle(Request
the HTTP request to handle
request
,
Response
the HTTP response to handle
response
,
Callback
the callback to complete when the handling is complete
callback
)

Overrides org.eclipse.jetty.server.handler.EventsHandler.handle.

Implements org.eclipse.jetty.server.Request.Handler.handle.

Invoked to handle the passed HTTP request and response.

Inherited from org.eclipse.jetty.server.handler.StatisticsHandler:
doStartdumpgetBytesReadgetBytesWrittengetFailuresgetHandleActivegetHandleActiveMaxgetHandleTimeMaxgetHandleTimeMeangetHandleTimeStdDevgetHandleTimeTotalgetHandleTotalgetHandlingFailuresgetRequestsgetRequestsActivegetRequestsActiveMaxgetRequestTimeMaxgetRequestTimeMeangetRequestTimeStdDevgetRequestTimeTotalgetRequestTotalgetResponses1xxgetResponses2xxgetResponses3xxgetResponses4xxgetResponses5xxgetStatisticsDurationonAfterHandlingonBeforeHandlingonCompleteonRequestReadonResponseBeginonResponseWritereset

Field Detail

_minimumReadRateback to summary
private final long _minimumReadRate
_minimumWriteRateback to summary
private final long _minimumWriteRate

Constructor Detail

MinimumDataRateHandlerback to summary
public MinimumDataRateHandler(long minimumReadRate, long minimumWriteRate)

Creates a MinimumDataRateHandler with the specified read and write rates.

Parameters
minimumReadRate:long

the minimum number of bytes to be read per second, or 0 for not checking the read rate.

minimumWriteRate:long

the minimum number of bytes to be written per second, or 0 for not checking the write rate.

MinimumDataRateHandlerback to summary
public MinimumDataRateHandler(Handler handler, long minimumReadRate, long minimumWriteRate)

Creates a MinimumDataRateHandler with the specified read and write rates.

Parameters
handler:Handler

the handler to wrap.

minimumReadRate:long

the minimum number of bytes to be read per second, or 0 for not checking the read rate.

minimumWriteRate:long

the minimum number of bytes to be written per second, or 0 for not checking the write rate.

Method Detail

handleback to summary
public boolean handle(Request request, Response response, Callback callback) throws Exception

Overrides org.eclipse.jetty.server.handler.EventsHandler.handle.

Implements org.eclipse.jetty.server.Request.Handler.handle.

Doc from org.eclipse.jetty.server.Request.Handler.handle.

Invoked to handle the passed HTTP request and response.

The request is accepted by returning true, then handling must be concluded by completing the passed callback. The handling may be asynchronous, i.e. this method may return true and complete the given callback later, possibly from a different thread. If this method returns false, then the callback must not be invoked and any mutation on the response reversed.

Exceptions thrown by this method may be subsequently handled by an error Request.Handler, if present, otherwise a default HTTP 500 error is generated and the callback completed while writing the error response.

The simplest implementation is:

public boolean handle(Request request, Response response, Callback callback)
{
    callback.succeeded();
    return true;
}

A HelloWorld implementation is:

public boolean handle(Request request, Response response, Callback callback)
{
    response.write(true, ByteBuffer.wrap("Hello World\n".getBytes(StandardCharsets.UTF_8)), callback);
    return true;
}
Parameters
request:Request

the HTTP request to handle

response:Response

the HTTP response to handle

callback:Callback

the callback to complete when the handling is complete

Returns:boolean

True if and only if the request will be handled, a response generated and the callback eventually called. This may occur within the scope of the call to this method, or asynchronously some time later. If false is returned, then this method must not generate a response, nor complete the callback.

Annotations
@Override
Exceptions
Exception:
if there is a failure during the handling. Catchers cannot assume that the callback will be called and thus should attempt to complete the request as if a false had been returned.
org.eclipse.jetty.server.handler back to summary

protected Class StatisticsHandler.MinimumDataRateHandler.MinimumDataRateRequest

extends Wrapper
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Content.Chunk

Constructor Summary

AccessConstructor and Description
private

Field Detail

_errorContentback to summary
private Content.Chunk _errorContent

Constructor Detail

MinimumDataRateRequestback to summary
private MinimumDataRateRequest(Request request)

Method Detail

dataRatePerSecondback to summary
private long dataRatePerSecond(long dataCount)
demandback to summary
public void demand(Runnable demandCallback)

Overrides org.eclipse.jetty.server.Request.Wrapper.demand.

Implements org.eclipse.jetty.server.Request.demand.

Doc from org.eclipse.jetty.server.Request.demand.

Demands to invoke the given demand callback parameter when a chunk of content is available.

See how to use this method idiomatically.

Implementations guarantee that calls to this method are safely reentrant so that stack overflows are avoided in the case of mutual recursion between the execution of the Runnable callback and a call to this method. Invocations of the passed Runnable are serialized and a callback for demand call is not invoked until any previous demand callback has returned. Thus the Runnable should not block waiting for a callback of a future demand call.

The demand callback may be invoked spuriously: a subsequent call to read() may return null.

Calling this method establishes a pending demand, which is fulfilled when the demand callback is invoked.

Calling this method when there is already a pending demand results in an IllegalStateException to be thrown.

If the invocation of the demand callback throws an exception, then fail(Throwable) is called.

Parameters
demandCallback:Runnable

the demand callback to invoke when there is a content chunk available.

Annotations
@Override
readback to summary
public Content.Chunk read()

Overrides org.eclipse.jetty.server.Request.Wrapper.read.

Implements org.eclipse.jetty.server.Request.read.

Doc from org.eclipse.jetty.server.Request.read.

Reads a chunk of content.

See how to use this method idiomatically.

The returned chunk could be:

  • null, to signal that there isn't a chunk of content available
  • an Chunk instance with non null Chunk#getFailure(), to signal that there was a failure trying to produce a chunk of content, or that the content production has been failed externally
  • a Chunk instance, containing the chunk of content.

Once a read returns an Chunk instance with non-null Chunk#getFailure() then if the failure is last further reads will continue to return the same failure chunk instance, otherwise further read() operations may return different non-failure chunks.

Once a read returns a last chunk, further reads will continue to return a last chunk (although the instance may be different).

The content reader code must ultimately arrange for a call to Chunk#release() on the returned Chunk.

Additionally, prior to the ultimate call to Chunk#release(), the reader code may make additional calls to Chunk#retain(), that must ultimately be matched by a correspondent number of calls to Chunk#release().

Concurrent reads from different threads are not recommended, as they are inherently in a race condition.

Reads performed outside the invocation context of a demand callback are allowed. However, reads performed with a pending demand are inherently in a race condition (the thread that reads with the thread that invokes the demand callback).

In addition, the returned Content.Chunk may be a Trailers instance, in case of request content trailers.

Returns:Content.Chunk

Doc from org.eclipse.jetty.io.Content.Source.read.

a chunk of content, possibly a failure instance, or null

Annotations
@Override
org.eclipse.jetty.server.handler back to summary

protected Class StatisticsHandler.MinimumDataRateHandler.MinimumDataRateResponse

extends Wrapper
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public StatisticsHandler.MinimumDataRateHandler.MinimumDataRateRequest
public void
write(boolean
whether the ByteBuffer is the last to write
last
,
ByteBuffer
the ByteBuffer to write
byteBuffer
,
Callback
the callback to notify when the write operation is complete
callback
)

Overrides org.eclipse.jetty.server.Response.Wrapper.write.

Implements org.eclipse.jetty.server.Response.write.

Writes the given ByteBuffer, notifying the Callback when the write is complete.

Inherited from org.eclipse.jetty.server.Response.Wrapper:
getHeadersgetStatusgetTrailersSuppliergetWrappedhasLastWriteisCommittedisCompletedSuccessfullyresetsetStatussetTrailersSupplierwriteInterim

Constructor Detail

MinimumDataRateResponseback to summary
public MinimumDataRateResponse(StatisticsHandler.MinimumDataRateHandler.MinimumDataRateRequest request, Response wrapped)

Method Detail

getRequestback to summary
public StatisticsHandler.MinimumDataRateHandler.MinimumDataRateRequest getRequest()

Overrides org.eclipse.jetty.server.Response.Wrapper.getRequest.

Implements org.eclipse.jetty.server.Response.getRequest.

Returns:StatisticsHandler.MinimumDataRateHandler.MinimumDataRateRequest

Doc from org.eclipse.jetty.server.Response.getRequest.

the Request associated with this Response

Annotations
@Override
writeback to summary
public void write(boolean last, ByteBuffer byteBuffer, Callback callback)

Overrides org.eclipse.jetty.server.Response.Wrapper.write.

Implements org.eclipse.jetty.server.Response.write.

Doc from org.eclipse.jetty.server.Response.write.

Writes the given ByteBuffer, notifying the Callback when the write is complete.

Implementations guarantee that calls to this method are safely reentrant so that stack overflows are avoided in the case of mutual recursion between the execution of the Callback and a call to this method.

The invocation of the passed Callback is serialized with previous calls of this method, so that it is not invoked until any invocation of the callback of a previous call to this method has returned.

Thus a Callback should not block waiting for a callback of a future call to this method.

Parameters
last:boolean

whether the ByteBuffer is the last to write

byteBuffer:ByteBuffer

the ByteBuffer to write

callback:Callback

the callback to notify when the write operation is complete

Annotations
@Override