org.geoserver.wms.WMS.setApplicationContext()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.geoserver.wms.WMS.setApplicationContext()方法的一些代码示例,展示了WMS.setApplicationContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WMS.setApplicationContext()方法的具体详情如下:
包路径:org.geoserver.wms.WMS
类名称:WMS
方法名:setApplicationContext

WMS.setApplicationContext介绍

暂无

代码示例

代码示例来源:origin: org.geoserver.community/gs-wps-download

@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  this.wms.setApplicationContext(applicationContext);
  List<Service> services = GeoServerExtensions.extensions(Service.class, applicationContext);
  this.service =
      services.stream()
          .filter(s -> "WMS".equalsIgnoreCase(s.getId()))
          .findFirst()
          .orElse(null);
  if (service == null) {
    throw new RuntimeException("Could not find a WMS service");
  }
}

代码示例来源:origin: org.geoserver/gs-wms

@Before
public void internalSetUp() throws IOException {
  this.catalog = getCatalog();
  geosConfig = new GeoServerImpl();
  geosInfo = new GeoServerInfoImpl(geosConfig);
  geosInfo.setContact(new ContactInfoImpl());
  geosConfig.setGlobal(geosInfo);
  wmsInfo = new WMSInfoImpl();
  geosConfig.add(wmsInfo);
  geosConfig.setCatalog(catalog);
  wmsConfig = new WMS(geosConfig);
  wmsConfig.setApplicationContext(applicationContext);
  req = new GetCapabilitiesRequest();
  req.setBaseUrl(baseUrl);
  getTestData()
      .copyTo(
          getClass().getResourceAsStream("/legendURL/BasicPolygons.png"),
          LegendSampleImpl.LEGEND_SAMPLES_FOLDER + "/BasicPolygons.png");
  getTestData()
      .copyTo(
          getClass().getResourceAsStream("/legendURL/Bridges.png"),
          LegendSampleImpl.LEGEND_SAMPLES_FOLDER + "/Bridges.png");
  Map<String, String> namespaces = new HashMap<String, String>();
  namespaces.put("xlink", "http://www.w3.org/1999/xlink");
  namespaces.put("wms", "http://www.opengis.net/wms");
  namespaces.put("ows", "http://www.opengis.net/ows");
  XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
  XPATH = XMLUnit.newXpathEngine();
}

相关文章