Class GzipResponseAndCallback
java.lang.Object
org.eclipse.jetty.server.Response.Wrapper
org.eclipse.jetty.server.handler.gzip.GzipResponseAndCallback
- All Implemented Interfaces:
Content.Sink
,Response
,Callback
,Invocable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
Callback.Completable, Callback.Completing, Callback.Nested
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.Task
Nested classes/interfaces inherited from interface org.eclipse.jetty.server.Response
Response.Wrapper
-
Field Summary
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP
-
Constructor Summary
ConstructorDescriptionGzipResponseAndCallback
(GzipHandler handler, Request request, Response response, Callback callback) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
commit
(boolean last, Callback callback, ByteBuffer content) void
Callback invoked when the operation fails.void
void
Callback invoked when the operation completes.void
write
(boolean last, ByteBuffer content, Callback callback) Writes the givenByteBuffer
, notifying theCallback
when the write is complete.Methods inherited from class org.eclipse.jetty.server.Response.Wrapper
getHeaders, getRequest, getStatus, getTrailersSupplier, getWrapped, hasLastWrite, isCommitted, isCompletedSuccessfully, reset, setStatus, setTrailersSupplier, writeInterim
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.Callback
completeWith
-
Constructor Details
-
GzipResponseAndCallback
public GzipResponseAndCallback(GzipHandler handler, Request request, Response response, Callback callback)
-
-
Method Details
-
succeeded
public void succeeded()Description copied from interface:Callback
Callback invoked when the operation completes.
-
failed
Description copied from interface:Callback
Callback invoked when the operation fails.
-
getInvocationType
- Specified by:
getInvocationType
in interfaceInvocable
- Returns:
- The InvocationType of this object
-
write
Description copied from interface:Response
Writes the given
ByteBuffer
, notifying theCallback
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.- Specified by:
write
in interfaceContent.Sink
- Specified by:
write
in interfaceResponse
- Overrides:
write
in classResponse.Wrapper
- Parameters:
last
- whether the ByteBuffer is the last to writecontent
- the ByteBuffer to writecallback
- the callback to notify when the write operation is complete
-
commit
-
noCompression
public void noCompression()
-