Services
Many of the interface implementations that were discussed in previous sections require additional configuration in order to make them useful. For instance, the LDAP adaptor needs to understand what service to connect to and which bind credentials to use. A File Adaptor needs to know which directory it should store and retrieve files from, and in what Content Type. An authorizationHandler may need to know which policies to use or what script to execute.
When Adaptors, Logs or authorizationHandlers are configured in
Adaptive Framework, we bundle a configuration object into an object
instance of _AdaptiveServiceConf_
. These is used
to create what's known as a Service
. A service is
something that can be started, stopped or restarted by Adaptive
Framework. This allows an administrator to change configuration options
without having to restart the entire application.
The following example demonstrates what a service configuration object looks like, using the LMDB adaptor:
{
"serviceId": "adaptor-lmdb",
"startup": "immediate",
"conf": {
"type": "adaptor",
"adaptorType": "lmdb",
"adaptorId": "lmdb",
"description": "A LMDB database for person registry",
"env": {
"mapsize": 10485760,
"maxdbs": 128,
"maxreaders": 126,
"mode": 384,
"path": "/afw/lmdb"
}
}
}
This particular configuration will create a LMDB adaptor immediately upon startup.