|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.axis2.transport.http.server.SimpleHttpServer
A simple, but extensible HTTP server, mostly for testing purposes.
Constructor Summary | |
SimpleHttpServer()
Creates a new HTTP server instance, using an arbitrary free TCP port |
|
SimpleHttpServer(int port)
Creates a new HTTP server instance, using the specified TCP port |
|
SimpleHttpServer(int port,
ThreadFactory threadPool)
Creates a new HTTP server instance, using the specified TCP port |
|
SimpleHttpServer(SimpleSocketFactory socketfactory,
int port)
Creates a new HTTP server instance, using the specified socket factory and the TCP port |
|
SimpleHttpServer(SimpleSocketFactory socketfactory,
int port,
ThreadFactory threadPool)
Creates a new HTTP server instance, using the specified socket factory and the TCP port that uses the given ThreadPool. |
Method Summary | |
void |
destroy()
Stops this HTTP server instance. |
String |
getLocalAddress()
Returns the IP address that this HTTP server instance is bound to. |
int |
getLocalPort()
Returns the TCP port that this HTTP server instance is bound to. |
HttpRequestHandler |
getRequestHandler()
Returns the currently used HttpRequestHandler by this SimpleHttpServer |
String |
getTestname()
|
boolean |
isRunning()
Checks if this HTTP server instance is running. |
void |
run()
|
void |
setHttpService(HttpService service)
|
void |
setRequestHandler(HttpRequestHandler rh)
Sets the HttpRequestHandler to be used for this SimpleHttpServer. |
void |
setTestname(String testname)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleHttpServer() throws IOException
IOException
- if anything goes wrong during initializationpublic SimpleHttpServer(int port) throws IOException
port
- Desired TCP port
IOException
- if anything goes wrong during initializationpublic SimpleHttpServer(int port, ThreadFactory threadPool) throws IOException
port
- Desired TCP portthreadPool
- ThreadPool to be used.
IOException
- if anything goes wrong during initializationpublic SimpleHttpServer(SimpleSocketFactory socketfactory, int port) throws IOException
port
- Desired TCP port
IOException
- if anything goes wrong during initializationpublic SimpleHttpServer(SimpleSocketFactory socketfactory, int port, ThreadFactory threadPool) throws IOException
port
- Desired TCP portthreadPool
- ThreadPool to be used inside the SimpleHttpServer. The
threadPool object that is provided needs to implement
tp.execute(Runnable r)
IOException
- if anything goes wrong during initializationMethod Detail |
public void destroy()
public void run()
run
in interface Runnable
public String getLocalAddress()
null
if not runningpublic int getLocalPort()
public HttpRequestHandler getRequestHandler()
public String getTestname()
public boolean isRunning()
public void setHttpService(HttpService service)
public void setRequestHandler(HttpRequestHandler rh)
rh
- Request handler to be used, or null to disable.public void setTestname(String testname)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |