|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.gadgets.servlet.AccelHandler
public class AccelHandler
Handles requests for accel servlet. The objective is to accelerate web pages.
| Field Summary | |
|---|---|
protected ResponseRewriterRegistry |
contentRewriterRegistry
|
protected boolean |
remapInternalServerError
|
protected RequestPipeline |
requestPipeline
|
protected AccelUriManager |
uriManager
|
| Constructor Summary | |
|---|---|
AccelHandler(RequestPipeline requestPipeline,
ResponseRewriterRegistry contentRewriterRegistry,
AccelUriManager accelUriManager,
Boolean remapInternalServerError)
|
|
| Method Summary | |
|---|---|
protected HttpRequest |
buildHttpRequest(HttpRequest request,
ProxyUriManager.ProxyUri uriToProxyOrRewrite)
Build an HttpRequest object encapsulating the request details as requested by the user. |
protected HttpResponse |
fetch(HttpRequest request)
|
ProxyUriManager.ProxyUri |
getProxyUri(HttpRequest httpRequest)
Returns the proxy uri encapsulating the request uri. |
protected HttpResponse |
handleErrors(HttpResponse results)
Process errors when fetching uri using request pipeline and return the error response to be returned to the user if any. |
protected boolean |
isRecoverable(HttpRequest req,
HttpResponse results,
RewritingException exception)
Returns true in case the error encountered while rewriting the content is recoverable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final RequestPipeline requestPipeline
protected final ResponseRewriterRegistry contentRewriterRegistry
protected final AccelUriManager uriManager
protected final boolean remapInternalServerError
| Constructor Detail |
|---|
@Inject
public AccelHandler(RequestPipeline requestPipeline,
ResponseRewriterRegistry contentRewriterRegistry,
AccelUriManager accelUriManager,
Boolean remapInternalServerError)
| Method Detail |
|---|
protected HttpResponse fetch(HttpRequest request)
throws IOException,
GadgetException
IOException
GadgetException
public ProxyUriManager.ProxyUri getProxyUri(HttpRequest httpRequest)
throws GadgetException
httpRequest - The http request.
GadgetException - In case of errors.
protected boolean isRecoverable(HttpRequest req,
HttpResponse results,
RewritingException exception)
req - The http request for fetching the resource.results - The result of rewriting.exception - Exception caught.
protected HttpRequest buildHttpRequest(HttpRequest request,
ProxyUriManager.ProxyUri uriToProxyOrRewrite)
throws GadgetException
request - The http request.uriToProxyOrRewrite - The parsed uri to proxy or rewrite through
accel servlet.
GadgetException - In case the data could not be fetched.protected HttpResponse handleErrors(HttpResponse results)
results - The http response returned by request pipeline.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||