OpenSimulator Internals/Connector Architecture
Appearance
OpenSimulator Internals/Connector Architecture
Overview
The connector handles network calls transparently. Calling code does not need to know whether the service is local (standalone) or remote (grid mode) -- the connector abstracts that distinction.
In standalone mode the connector calls the service directly in-process. In grid mode it makes an HTTP call to ROBUST. Same interface either way.
The Five Components
Up to five components are involved in connecting simulator code to a grid service.
| Component | Location | Description |
|---|---|---|
| Simulator code | OpenSimulator core or a module | Makes the initial service call to get or set data. |
| Simulator service connector | OpenSim/Region/CoreModules/ServiceConnectorsOut (outbound), ServiceConnectorsIn (inbound) | Two flavours: local (same process, standalone -- calls service directly) and remote (grid mode -- delegates to remote service connector for network call). |
| Remote service connector | OpenSim/Services/Connectors | Marshals data and makes the network call to the remote service. Not used for in-process connections. |
| Remote service handler | OpenSim/Server/Handlers | Unpacks the incoming network call and passes it to the service. Not used for in-process connections. |
| The service | OpenSim/Services/[ServiceName] (e.g. OpenSim/Services/AssetService) | Actually services the call and returns data. |
Configuration
Standalone
Connectors and service in the same process:
[Modules] AssetServices = "LocalAssetServicesConnector" [AssetService] LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService"
Grid
Service runs remotely:
[Modules] AssetServices = "RemoteAssetServicesConnector" [AssetService] AssetServerURI = "http://myassetserver.com:8003"
Example: Asset Get
Standalone path
- Simulator calls Scene.AssetService.Get()
- Routes to LocalAssetServiceConnector.Get()
- Checks cache
- On miss, calls AssetService.Get()
- AssetService retrieves from persistent storage
Grid path
- Simulator calls Scene.AssetService.Get()
- Routes to RemoteAssetServiceConnector.Get()
- Inherits from OpenSim/Services/Connectors/AssetServiceConnector
- Makes HTTP GET to http://yourassetserver/assets/assetId
- Received by OpenSim/Server/Handlers/Asset/AssetServerConnector
- AssetServerGetHandler unpacks request, calls AssetService
- Returns asset as XML on success, 404 on miss