public static class HTTPWrap.ServerContainer extends org.mozilla.javascript.ScriptableObject implements HttpServerStub
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASS_NAME |
| Constructor and Description |
|---|
HTTPWrap.ServerContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
fatalError(String message,
Object stack)
This method is called when the whole server has failed or is shutting down prematurely.
|
protected String |
formatDate() |
String |
getClassName() |
org.mozilla.javascript.Function |
getMakeRequest() |
org.mozilla.javascript.Function |
getMakeResponse() |
org.mozilla.javascript.Function |
getMakeSocket() |
org.mozilla.javascript.Function |
getOnClose() |
org.mozilla.javascript.Function |
getOnComplete() |
org.mozilla.javascript.Function |
getOnData() |
org.mozilla.javascript.Function |
getOnHeaders() |
org.mozilla.javascript.Function |
getOnUpgrade() |
int |
listen(String host,
int port,
int backlog) |
void |
onClose(HttpRequestAdapter request,
HttpResponseAdapter response)
This method is called when the server is finally shut down.
|
void |
onConnection()
This method is called on each new network connection.
|
void |
onData(HttpRequestAdapter request,
HttpResponseAdapter response,
HttpDataAdapter data)
This method is called on each chunk of additional data.
|
void |
onError(String message)
This method is called on an error.
|
void |
onError(String message,
Throwable cause) |
void |
onRequest(HttpRequestAdapter request,
HttpResponseAdapter response)
This method is called on each new HTTP request.
|
void |
onUpgrade(HttpRequestAdapter request,
UpgradedSocket socket)
The adapter should call this method if it detects that an "upgrade" request was made by the
client.
|
void |
setDefaultTimeout(long timeout,
TimeUnit unit,
int statusCode,
String contentType,
String message)
Set a default timeout that will be used for all HTTP requests unless overridden.
|
void |
setMakeRequest(org.mozilla.javascript.Function mr) |
void |
setMakeResponse(org.mozilla.javascript.Function mr) |
void |
setMakeSocket(org.mozilla.javascript.Function mr) |
void |
setOnClose(org.mozilla.javascript.Function oc) |
void |
setOnComplete(org.mozilla.javascript.Function onComplete) |
void |
setOnData(org.mozilla.javascript.Function onData) |
void |
setOnHeaders(org.mozilla.javascript.Function onHeaders) |
void |
setOnUpgrade(org.mozilla.javascript.Function onComplete) |
static void |
setSslContext(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
Object[] args,
org.mozilla.javascript.Function func)
This will be called by the "adaptorhttps" module, which in turn uses our own "tls" module
to create an SSL context that obeys all the various rules of Node.js.
|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, equivalentValues, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasInstance, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizepublic static final String CLASS_NAME
public String getClassName()
getClassName in interface org.mozilla.javascript.ScriptablegetClassName in class org.mozilla.javascript.ScriptableObject@JSFunction
public static void setSslContext(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
Object[] args,
org.mozilla.javascript.Function func)
@JSFunction public int listen(String host, int port, int backlog)
@JSFunction public void close()
@JSFunction public void fatalError(String message, Object stack)
public void onRequest(HttpRequestAdapter request, HttpResponseAdapter response)
HttpServerStubonRequest in interface HttpServerStubpublic void onUpgrade(HttpRequestAdapter request, UpgradedSocket socket)
HttpServerStubonUpgrade in interface HttpServerStubpublic void onData(HttpRequestAdapter request, HttpResponseAdapter response, HttpDataAdapter data)
HttpServerStubonData in interface HttpServerStubpublic void onConnection()
HttpServerStubonConnection in interface HttpServerStubpublic void onClose(HttpRequestAdapter request, HttpResponseAdapter response)
HttpServerStubonClose in interface HttpServerStubpublic void onError(String message)
HttpServerStubonError in interface HttpServerStubpublic void onError(String message, Throwable cause)
onError in interface HttpServerStubpublic void setDefaultTimeout(long timeout,
TimeUnit unit,
int statusCode,
String contentType,
String message)
HttpServerStubsetDefaultTimeout in interface HttpServerStub@JSGetter(value="makeSocket") public org.mozilla.javascript.Function getMakeSocket()
@JSSetter(value="makeSocket") public void setMakeSocket(org.mozilla.javascript.Function mr)
@JSGetter(value="makeRequest") public org.mozilla.javascript.Function getMakeRequest()
@JSSetter(value="makeRequest") public void setMakeRequest(org.mozilla.javascript.Function mr)
@JSGetter(value="makeResponse") public org.mozilla.javascript.Function getMakeResponse()
@JSSetter(value="makeResponse") public void setMakeResponse(org.mozilla.javascript.Function mr)
@JSGetter(value="onheaders") public org.mozilla.javascript.Function getOnHeaders()
@JSSetter(value="onheaders") public void setOnHeaders(org.mozilla.javascript.Function onHeaders)
@JSGetter(value="ondata") public org.mozilla.javascript.Function getOnData()
@JSSetter(value="ondata") public void setOnData(org.mozilla.javascript.Function onData)
@JSGetter(value="oncomplete") public org.mozilla.javascript.Function getOnComplete()
@JSSetter(value="oncomplete") public void setOnComplete(org.mozilla.javascript.Function onComplete)
@JSGetter(value="onupgrade") public org.mozilla.javascript.Function getOnUpgrade()
@JSSetter(value="onupgrade") public void setOnUpgrade(org.mozilla.javascript.Function onComplete)
@JSGetter(value="onclose") public org.mozilla.javascript.Function getOnClose()
@JSSetter(value="onclose") public void setOnClose(org.mozilla.javascript.Function oc)
protected String formatDate()
Copyright © 2016 Apigee Corporation. All Rights Reserved.