|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectAbstractLifeCycle
org.eclipse.smila.http.server.internal.HttpServer
public class HttpServer
Implements a HTTP server. (1) Create an instance of HttpServer. (2) Create an instance of HttpHandler. HttpHandler.handle will be invoked to process a request associated with the request URL path. The members of HttpExchange may be called to process the request and to generate the related response within HttpHandler.handle. (3) Create an instance of HttpContext to associate HttpHandler with a request URL path and pass it to HttpServer using HttpServer.addContext. (4) Repeat the steps (2) and (3), if more URL path/handler pairs are necessary. (5) Use HttpServer.start to start the server. (6) Use HttpServer.stop to stop the server.
| Constructor Summary | |
|---|---|
HttpServer(XmlConfiguration configuration)
create server from configuration. |
|
| Method Summary | |
|---|---|
void |
addHttpHandler(HttpHandler smilaHandler)
add a SMILA http handler to this server. |
void |
addJettyHandler(JettyHandler jettyHandler)
add a context with a jetty-handler to this server. |
protected void |
doStart()
|
protected void |
doStop()
|
protected int |
getPort()
|
void |
join()
wait for server to shutdown. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpServer(XmlConfiguration configuration)
throws java.lang.Exception
configuration - jetty.xml configuration
java.lang.Exception - error creating server| Method Detail |
|---|
protected int getPort()
public void addHttpHandler(HttpHandler smilaHandler)
smilaHandler - a SMILA http handler to install.public void addJettyHandler(JettyHandler jettyHandler)
jettyHandler - a JettyHandler to install
public void join()
throws java.lang.InterruptedException
java.lang.InterruptedException - waiting was interrupted.protected void doStart()
AbstractLifeCycle#doStart()protected void doStop()
AbstractLifeCycle#doStop()
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||