Class VertxBrowserHelper.Server
- java.lang.Object
-
- ptolemy.actor.lib.jjs.modules.userInterface.VertxBrowserHelper.Server
-
- Enclosing class:
- VertxBrowserHelper
public class VertxBrowserHelper.Server extends java.lang.Object
A http server that gets and sets responses.
-
-
Constructor Summary
Constructors Constructor Description Server(int port)
Instantiate a http server that listens only on localhost.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResource(java.lang.String path, java.lang.Object resource, java.lang.String contentType)
Add a resource to be served by the server.void
setResponse(java.lang.String response)
Set the response.void
shutdown()
Shut down the server, if running.
-
-
-
Method Detail
-
addResource
public void addResource(java.lang.String path, java.lang.Object resource, java.lang.String contentType)
Add a resource to be served by the server.- Parameters:
path
- The path to the resource.resource
- The resource to serve upon a request for this path.contentType
- The content type.
-
setResponse
public void setResponse(java.lang.String response)
Set the response.- Parameters:
response
- The response.
-
shutdown
public void shutdown()
Shut down the server, if running.
-
-