OpenSimulator Internals/Connector Architecture
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
Note: In OpenSimulator 0.9.2, LocalAssetServiceConnector, RemoteAssetServiceConnector, and HGAssetBroker were replaced by a single module RegionAssetConnector. LocalAssetServiceConnector is still present but only used in tests. The paths below reflect the current architecture.
Standalone path
- Simulator calls Scene.AssetService.Get()
- Routes to RegionAssetConnector.Get()
- Checks cache
- On miss, calls AssetService.Get() directly in-process
- AssetService retrieves from persistent storage
Grid path
- Simulator calls Scene.AssetService.Get()
- Routes to RegionAssetConnector.Get()
- Delegates to AssetServicesConnector (OpenSim/Services/Connectors)
- 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
HyperGrid path
- Simulator calls Scene.AssetService.Get()
- Routes to RegionAssetConnector.Get()
- RegionAssetConnector determines if asset is local or foreign grid
- Foreign: instantiates GridAssetClient for the foreign grid
- Makes HTTP GET to foreign asset server
- Asset copied to local asset table on retrieval -- same UUID, no link back