public class HttpServerHelper extends VertxHelperBase
VertxHelperBase.AccessorVerticle
HelperBase.DATA_TYPE
_verticle, _vertx
_actor, _currentObj
Modifier and Type | Method and Description |
---|---|
void |
closeServer()
Close the web socket server.
|
AWTImageToken |
convertImageBody(java.lang.String body)
Convert a string to an image token.
|
static HttpServerHelper |
getOrCreateServer(java.lang.Object actor,
jdk.nashorn.api.scripting.ScriptObjectMirror currentObj,
java.lang.String hostInterface,
int port)
Create a HttpServerHelper instance to help a JavaScript HttpServer instance.
|
void |
respond(int requestID,
java.lang.String responseText,
int responseCode)
Respond to the request with the specified ID by sending the specified text.
|
void |
startServer()
Create and start the server and beginning listening for
requests.
|
_issueOrDeferResponse, _processPendingJob, _setBusy, closeVertx, getHelper, getImageTypes, reset, submit, supportedReceiveTypes, supportedSendTypes, undeploy
_appendNumericToBuffer, _appendToBuffer, _error, _error, _error, _error, _extractFromBuffer, _issueResponse, _removeDuplicates, _sizeOfType, _toJavaBytes, _toJSArray, getHelping
public void closeServer()
public AWTImageToken convertImageBody(java.lang.String body)
body
- The html to be converted.public static HttpServerHelper getOrCreateServer(java.lang.Object actor, jdk.nashorn.api.scripting.ScriptObjectMirror currentObj, java.lang.String hostInterface, int port)
actor
- The actor associated with this helper.currentObj
- The JavaScript HttpServer instance for which this is a helper.hostInterface
- The host interface to use, in case there the host has more
than one interface (e.g. Ethernet and WiFi). This is IP address or name, and if
the argument is null, then "localhost" will be used.port
- The port number that the server will use.public void respond(int requestID, java.lang.String responseText, int responseCode)
requestID
- The request ID.responseText
- The text with which to respond.responseCode
- The response codepublic void startServer()