com.continuuity.http
Class NettyHttpService

java.lang.Object
  extended by com.google.common.util.concurrent.AbstractIdleService
      extended by com.continuuity.http.NettyHttpService
All Implemented Interfaces:
com.google.common.util.concurrent.Service

public final class NettyHttpService
extends com.google.common.util.concurrent.AbstractIdleService

Webservice implemented using the netty framework. Implements Guava's Service interface to manage the states of the webservice.


Nested Class Summary
static class NettyHttpService.Builder
          Builder to help create the NettyHttpService.
 
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.Listener, com.google.common.util.concurrent.Service.State
 
Constructor Summary
NettyHttpService(InetSocketAddress bindAddress, int bossThreadPoolSize, int workerThreadPoolSize, int execThreadPoolSize, long execThreadKeepAliveSecs, Map<String,Object> channelConfigs, RejectedExecutionHandler rejectedExecutionHandler, URLRewriter urlRewriter, Iterable<? extends HttpHandler> httpHandlers, Iterable<? extends HandlerHook> handlerHooks, int httpChunkLimit)
          Deprecated. Use NettyHttpService.Builder instead.
 
Method Summary
static NettyHttpService.Builder builder()
           
 InetSocketAddress getBindAddress()
           
protected  void shutDown()
           
protected  void startUp()
           
 
Methods inherited from class com.google.common.util.concurrent.AbstractIdleService
addListener, executor, isRunning, start, startAndWait, state, stop, stopAndWait, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NettyHttpService

@Deprecated
public NettyHttpService(InetSocketAddress bindAddress,
                                   int bossThreadPoolSize,
                                   int workerThreadPoolSize,
                                   int execThreadPoolSize,
                                   long execThreadKeepAliveSecs,
                                   Map<String,Object> channelConfigs,
                                   RejectedExecutionHandler rejectedExecutionHandler,
                                   URLRewriter urlRewriter,
                                   Iterable<? extends HttpHandler> httpHandlers,
                                   Iterable<? extends HandlerHook> handlerHooks,
                                   int httpChunkLimit)
Deprecated. Use NettyHttpService.Builder instead.

Initialize NettyHttpService.

Parameters:
bindAddress - Address for the service to bind to.
bossThreadPoolSize - Size of the boss thread pool.
workerThreadPoolSize - Size of the worker thread pool.
execThreadPoolSize - Size of the thread pool for the executor.
execThreadKeepAliveSecs - maximum time that excess idle threads will wait for new tasks before terminating.
channelConfigs - Configurations for the server socket channel.
rejectedExecutionHandler - rejection policy for executor.
urlRewriter - URLRewriter to rewrite incoming URLs.
httpHandlers - HttpHandlers to handle the calls.
handlerHooks - Hooks to be called before/after request processing by httpHandlers.
Method Detail

builder

public static NettyHttpService.Builder builder()

startUp

protected void startUp()
                throws Exception
Specified by:
startUp in class com.google.common.util.concurrent.AbstractIdleService
Throws:
Exception

getBindAddress

public InetSocketAddress getBindAddress()
Returns:
port where the service is running.

shutDown

protected void shutDown()
                 throws Exception
Specified by:
shutDown in class com.google.common.util.concurrent.AbstractIdleService
Throws:
Exception


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