JBoss Modular Service Kernel API 1.0.0.Beta1

org.jboss.msc.services.http
Class HttpServerService

java.lang.Object
  extended by org.jboss.msc.services.http.HttpServerService
All Implemented Interfaces:
Service<com.sun.net.httpserver.HttpServer>, Value<com.sun.net.httpserver.HttpServer>

public final class HttpServerService
extends Object
implements Service<com.sun.net.httpserver.HttpServer>

An example service using the embedded JDK HTTP server found in some Java distributions.

Author:
David M. Lloyd

Field Summary
static Value<Method> EXECUTOR_SETTER
           
 Injector<Executor> executorInjector
           
 
Fields inherited from interface org.jboss.msc.service.Service
NULL, NULL_VALUE
 
Constructor Summary
HttpServerService()
           
 
Method Summary
 int getBacklog()
           
 InetSocketAddress getBindAddress()
           
 Executor getExecutor()
           
 int getStopDelay()
           
 com.sun.net.httpserver.HttpServer getValue()
          Get the actual value.
 void setBacklog(int backlog)
           
 void setBindAddress(InetSocketAddress bindAddress)
           
 void setExecutor(Executor executor)
           
 void setStopDelay(int stopDelay)
           
 void start(StartContext context)
          Start the service.
 void stop(StopContext context)
          Stop the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXECUTOR_SETTER

public static final Value<Method> EXECUTOR_SETTER

executorInjector

public final Injector<Executor> executorInjector
Constructor Detail

HttpServerService

public HttpServerService()
Method Detail

getExecutor

public Executor getExecutor()

setExecutor

public void setExecutor(Executor executor)

getStopDelay

public int getStopDelay()

setStopDelay

public void setStopDelay(int stopDelay)

start

public void start(StartContext context)
           throws StartException
Description copied from interface: Service
Start the service. Do not return until the service has been fully started, unless an asynchronous service start is performed. All injections will be complete before this method is called.

Specified by:
start in interface Service<com.sun.net.httpserver.HttpServer>
Parameters:
context - the context which can be used to trigger an asynchronous service start
Throws:
StartException - if the service could not be started for some reason

stop

public void stop(StopContext context)
Description copied from interface: Service
Stop the service. Do not return until the service has been fully stopped, unless an asynchronous service stop is performed. All injections will remain intact until the service is fully stopped. This method should not throw an exception.

Specified by:
stop in interface Service<com.sun.net.httpserver.HttpServer>
Parameters:
context - the context which can be used to trigger an asynchronous service stop

getBacklog

public int getBacklog()

setBacklog

public void setBacklog(int backlog)

getBindAddress

public InetSocketAddress getBindAddress()

setBindAddress

public void setBindAddress(InetSocketAddress bindAddress)

getValue

public com.sun.net.httpserver.HttpServer getValue()
                                           throws IllegalStateException
Description copied from interface: Value
Get the actual value.

Specified by:
getValue in interface Value<com.sun.net.httpserver.HttpServer>
Returns:
the actual value
Throws:
IllegalStateException - if the value is time-sensitive and the current state does not allow retrieval.

JBoss Modular Service Kernel API 1.0.0.Beta1

Copyright © 2010 JBoss, a division of Red Hat, Inc.