领域空间信息服务 SPI 为用户构建领域空间信息服务组件提供了一系列接口。如 ProviderContextAware,ComponentContextAware,InterfaceContextAware 以及 ProviderContext,ComponentContext,InterfaceContext。
XXXContextAware 是 SuperMap iServer 为各个层次的服务模块提供的上下文依赖接口。通过实现该接口的 setXXXContext(XXXContext context)方法,SuperMap iServer 会通过依赖注入技术将服务配置文件中与 DSS 关联的上下文信息(XXXContext 对象)赋予 DSS。DSS 在获取了 XXXContext 后,就可以直接调用关联的模块对象。如下图,在 Component 层构建的 DSSComponent 通过实现 ComponentContextAware 的 setComponentContext(ComponentContext context)方法后,通过 ComponentContext 获取到所需的 Provider 对象,对该对象的 GIS 功能进行重组。