|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrestart.server.RestServer
public class RestServer
Constructor Summary | |
---|---|
RestServer(int port)
Create a REST Server listening on a given port, with default RestServer policies |
|
RestServer(int port,
RestServerPolicy policy)
Create a REST Server listening on a given port with the given policies. |
Method Summary | |
---|---|
void |
addService(Service service)
Add (expose) a service to the server. |
ServerThread[] |
getConnections()
Get connections |
java.lang.String |
getHostName()
Get the current hostname. |
Service |
getService(java.lang.String name)
Get a service by its name. |
java.lang.String[] |
getServiceNames()
Get all service names. |
void |
removeService(Service service)
Remove the given service from the server. |
void |
start()
Start the server : expose the services and listen for connections |
boolean |
stopServer()
Should stop the server ? |
void |
stopServer(boolean stopAllThreads)
Gently stop the server if the given param is false, or force stop the server if the given param is true. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RestServer(int port)
port
- the port the server will listen to (default : 80)public RestServer(int port, RestServerPolicy policy)
port
- the port the server will listen to (default : 80)soTimeout
- the so_timeout to be affected to accepted socketsMethod Detail |
---|
public void addService(Service service)
service
- the service to be addedpublic void removeService(Service service)
service
- the service to be removedpublic Service getService(java.lang.String name)
name
-
public java.lang.String[] getServiceNames()
public void start() throws java.io.IOException
java.io.IOException
public ServerThread[] getConnections()
public boolean stopServer()
public void stopServer(boolean stopAllThreads)
stopAllThreads
- true to force kill all running threads and active connectionspublic java.lang.String getHostName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |