com.continuuity.http
Class AbstractHttpHandler

java.lang.Object
  extended by com.continuuity.http.AbstractHttpHandler
All Implemented Interfaces:
HttpHandler

public abstract class AbstractHttpHandler
extends Object
implements HttpHandler

A base implementation of HttpHandler that provides a method for sending a request to other handlers that exist in the same server.


Constructor Summary
AbstractHttpHandler()
           
 
Method Summary
 void destroy(HandlerContext context)
          destroy method will be called before shutdown.
 void init(HandlerContext context)
          init method will be called before the netty pipeline is setup.
protected  InternalHttpResponse sendInternalRequest(org.jboss.netty.handler.codec.http.HttpRequest request)
          Send a request to another handler internal to the server, getting back the response body and response code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractHttpHandler

public AbstractHttpHandler()
Method Detail

init

public void init(HandlerContext context)
Description copied from interface: HttpHandler
init method will be called before the netty pipeline is setup. Any initialization operation can be performed in this method.

Specified by:
init in interface HttpHandler
Parameters:
context - instance of HandlerContext.

destroy

public void destroy(HandlerContext context)
Description copied from interface: HttpHandler
destroy method will be called before shutdown. Any teardown task can be performed in this method. At this point the server will not accept any more new requests.

Specified by:
destroy in interface HttpHandler
Parameters:
context - instance of HandlerContext.

sendInternalRequest

protected InternalHttpResponse sendInternalRequest(org.jboss.netty.handler.codec.http.HttpRequest request)
Send a request to another handler internal to the server, getting back the response body and response code.

Parameters:
request - request to send to another handler.
Returns:
BasicInternalHttpResponse containing the response code and body.


Copyright 2013 Continuuity, Inc. Licensed under the Apache License, Version 2.0