JBoss Modular Service Kernel API 1.0.0.Beta1

org.jboss.msc.services.http
Class HttpContextService

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

public final class HttpContextService
extends Object
implements Service<com.sun.net.httpserver.HttpContext>

An HTTP context.

Author:
David M. Lloyd

Field Summary
static Value<Method> HANDLER_SETTER
           
 Injector<com.sun.net.httpserver.HttpHandler> httpHandlerInjector
           
 Injector<com.sun.net.httpserver.HttpServer> httpServerInjector
           
static Value<Method> PATH_SETTER
           
 Injector<String> pathInjector
           
static Value<Method> SERVER_SETTER
           
 
Fields inherited from interface org.jboss.msc.service.Service
NULL, NULL_VALUE
 
Constructor Summary
HttpContextService()
           
 
Method Summary
 com.sun.net.httpserver.HttpHandler getHandler()
           
 String getPath()
           
 com.sun.net.httpserver.HttpServer getServer()
           
 com.sun.net.httpserver.HttpContext getValue()
          Get the actual value.
 void setHandler(com.sun.net.httpserver.HttpHandler handler)
           
 void setPath(String path)
           
 void setServer(com.sun.net.httpserver.HttpServer server)
           
 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

SERVER_SETTER

public static final Value<Method> SERVER_SETTER

HANDLER_SETTER

public static final Value<Method> HANDLER_SETTER

PATH_SETTER

public static final Value<Method> PATH_SETTER

httpServerInjector

public final Injector<com.sun.net.httpserver.HttpServer> httpServerInjector

httpHandlerInjector

public final Injector<com.sun.net.httpserver.HttpHandler> httpHandlerInjector

pathInjector

public final Injector<String> pathInjector
Constructor Detail

HttpContextService

public HttpContextService()
Method Detail

getPath

public String getPath()

setPath

public void setPath(String path)

getHandler

public com.sun.net.httpserver.HttpHandler getHandler()

setHandler

public void setHandler(com.sun.net.httpserver.HttpHandler handler)

getServer

public com.sun.net.httpserver.HttpServer getServer()

setServer

public void setServer(com.sun.net.httpserver.HttpServer server)

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.HttpContext>
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.HttpContext>
Parameters:
context - the context which can be used to trigger an asynchronous service stop

getValue

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

Specified by:
getValue in interface Value<com.sun.net.httpserver.HttpContext>
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.