Package org.apache.solr.jersey.container
Class JettyBridgeResponseWriter
- java.lang.Object
-
- org.apache.solr.jersey.container.JettyBridgeResponseWriter
-
- All Implemented Interfaces:
org.glassfish.jersey.server.spi.ContainerResponseWriter
public class JettyBridgeResponseWriter extends Object implements org.glassfish.jersey.server.spi.ContainerResponseWriter
A ResponseWriter which copies that output of JAX-RS computation over toHttpServletResponseobject used by the Jetty server.Since we're not running Jersey as a full server or as a servlet that Jetty knows about, we need to connect the response Jersey outputs with the actual objects that Jetty sends back to clients.
Inspired and partially copied from the JettyHttpContainer.ResponseWriter class available in the jersey-container-jetty-http artifact.
-
-
Constructor Summary
Constructors Constructor Description JettyBridgeResponseWriter(javax.servlet.http.HttpServletResponse httpServletResponse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit()booleanenableResponseBuffering()voidfailure(Throwable error)voidsetSuspendTimeout(long timeOut, TimeUnit timeUnit)booleansuspend(long timeOut, TimeUnit timeUnit, org.glassfish.jersey.server.spi.ContainerResponseWriter.TimeoutHandler timeoutHandler)OutputStreamwriteResponseStatusAndHeaders(long contentLength, org.glassfish.jersey.server.ContainerResponse context)
-
-
-
Method Detail
-
writeResponseStatusAndHeaders
public OutputStream writeResponseStatusAndHeaders(long contentLength, org.glassfish.jersey.server.ContainerResponse context) throws org.glassfish.jersey.server.ContainerException
- Specified by:
writeResponseStatusAndHeadersin interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter- Throws:
org.glassfish.jersey.server.ContainerException
-
suspend
public boolean suspend(long timeOut, TimeUnit timeUnit, org.glassfish.jersey.server.spi.ContainerResponseWriter.TimeoutHandler timeoutHandler)- Specified by:
suspendin interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter
-
setSuspendTimeout
public void setSuspendTimeout(long timeOut, TimeUnit timeUnit) throws IllegalStateException- Specified by:
setSuspendTimeoutin interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter- Throws:
IllegalStateException
-
commit
public void commit()
- Specified by:
commitin interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter
-
failure
public void failure(Throwable error)
- Specified by:
failurein interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter
-
enableResponseBuffering
public boolean enableResponseBuffering()
- Specified by:
enableResponseBufferingin interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter
-
-