コード例 #1
0
 public void addMapIndex(MapContainer mapContainer) {
   final Indexes indexes = mapContainer.getIndexes();
   if (indexes.hasIndex()) {
     MapIndexInfo mapIndexInfo = new MapIndexInfo(mapContainer.getName());
     for (Index index : indexes.getIndexes()) {
       mapIndexInfo.addIndexInfo(index.getAttributeName(), index.isOrdered());
     }
     indexInfoList.add(mapIndexInfo);
   }
 }
コード例 #2
0
 @Override
 public void run() throws Exception {
   MapService mapService = getService();
   MapServiceContext mapServiceContext = mapService.getMapServiceContext();
   for (MapIndexInfo mapIndex : indexInfoList) {
     final MapContainer mapContainer = mapServiceContext.getMapContainer(mapIndex.mapName);
     final Indexes indexes = mapContainer.getIndexes();
     for (MapIndexInfo.IndexInfo indexInfo : mapIndex.lsIndexes) {
       indexes.addOrGetIndex(indexInfo.attributeName, indexInfo.ordered);
     }
   }
   for (InterceptorInfo interceptorInfo : interceptorInfoList) {
     final MapContainer mapContainer = mapServiceContext.getMapContainer(interceptorInfo.mapName);
     InterceptorRegistry interceptorRegistry = mapContainer.getInterceptorRegistry();
     Map<String, MapInterceptor> interceptorMap = interceptorRegistry.getId2InterceptorMap();
     List<Map.Entry<String, MapInterceptor>> entryList = interceptorInfo.interceptors;
     for (Map.Entry<String, MapInterceptor> entry : entryList) {
       if (!interceptorMap.containsKey(entry.getKey())) {
         interceptorRegistry.register(entry.getKey(), entry.getValue());
       }
     }
   }
 }