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 toHttpServletResponse
object 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 void
commit()
boolean
enableResponseBuffering()
void
failure(Throwable error)
void
setSuspendTimeout(long timeOut, TimeUnit timeUnit)
boolean
suspend(long timeOut, TimeUnit timeUnit, org.glassfish.jersey.server.spi.ContainerResponseWriter.TimeoutHandler timeoutHandler)
OutputStream
writeResponseStatusAndHeaders(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:
writeResponseStatusAndHeaders
in 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:
suspend
in interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter
-
setSuspendTimeout
public void setSuspendTimeout(long timeOut, TimeUnit timeUnit) throws IllegalStateException
- Specified by:
setSuspendTimeout
in interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter
- Throws:
IllegalStateException
-
commit
public void commit()
- Specified by:
commit
in interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter
-
failure
public void failure(Throwable error)
- Specified by:
failure
in interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter
-
enableResponseBuffering
public boolean enableResponseBuffering()
- Specified by:
enableResponseBuffering
in interfaceorg.glassfish.jersey.server.spi.ContainerResponseWriter
-
-