Builds a named JavaScript service that this app publishes for other apps to call. Obtained from newServiceBuilder on the controller mappings. Set the service object, which is a plain JavaScript object of functions, then call build to publish it. Under the version 2.0 engine the service is also stored per thread, so each Graal context gets its own copy of the object.
Group: Builders
Properties
| Property | Returns | Description |
|---|---|---|
| name | String | Name other apps look this service up by. |
| serviceObject | Map<String,Object> | The JavaScript object whose functions make up the service. |
Methods
getName()
Returns: String
Name other apps look this service up by.
getServiceObject()
Returns: Map<String,Object>
The JavaScript object whose functions make up the service.
serviceObject(Map<String,Object> o)
Returns: JsServiceBuilder
Sets the JavaScript object whose functions make up the service.
| Parameter | Description |
|---|---|
o | the service object, a map of function name to function |
build()
Returns: void
Publishes the service under its name so other apps can call it. Under the version 2.0 engine the service is registered in the thread local map as well as the shared one.