Changeset 370
- Timestamp:
- 09/02/08 22:50:21 (3 months ago)
- Location:
- trunk/geowebcache/src/main/java/org/geowebcache
- Files:
-
- 7 modified
-
GeoWebCacheDispatcher.java (modified) (1 diff)
-
layer/TileLayer.java (modified) (1 diff)
-
layer/wms/WMSLayer.java (modified) (12 diffs)
-
rest/SeedTask.java (modified) (2 diffs)
-
service/kml/KMLDebugGridLayer.java (modified) (2 diffs)
-
service/kml/KMLService.java (modified) (1 diff)
-
service/kml/KMZHelper.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/geowebcache/src/main/java/org/geowebcache/GeoWebCacheDispatcher.java
r346 r370 257 257 //tile.requestURI = request.getRequestURI(); 258 258 259 // A5) Ask the layer to provide the tile260 layer.get Response(tile);259 // A5) Ask the layer to provide the content for the tile 260 layer.getTile(tile); 261 261 262 262 // A6) Write response -
trunk/geowebcache/src/main/java/org/geowebcache/layer/TileLayer.java
r348 r370 179 179 * @throws IOException 180 180 */ 181 public abstract Tile getResponse(Tile tile) throws GeoWebCacheException, 182 IOException; 183 181 public abstract Tile getTile(Tile tile) 182 throws GeoWebCacheException, IOException; 183 184 public abstract void seedTile(Tile tile, boolean tryCache) 185 throws GeoWebCacheException, IOException; 186 184 187 /** 185 188 * This is a more direct way of requesting a tile without invoking -
trunk/geowebcache/src/main/java/org/geowebcache/layer/wms/WMSLayer.java
r348 r370 67 67 private String errormime; 68 68 69 //private int width;70 71 //private int height;72 73 69 private String version; 74 70 … … 85 81 private String vendorParameters; 86 82 87 //private boolean debugheaders;88 89 //protected transient GridCalculator[] gridCalc;90 91 //private transient int zoomStart;92 93 //private transient int zoomStop;94 95 //private transient String request;96 97 //protected transient String[] wmsURL;98 99 83 private transient int curWmsURL; 100 84 101 //private transient String wmsLayers;102 103 //private transient String wmsStyles;104 105 //private transient WMSParameters wmsparams;106 107 85 private transient boolean saveExpirationHeaders; 108 86 … … 134 112 135 113 private static transient Log log; 136 137 //public WMSLayer(String layerName, CacheFactory cacheFactory)138 // throws GeoWebCacheException {139 // name = layerName;140 // initCacheFactory = cacheFactory;141 // log = LogFactory.getLog(org.geowebcache.layer.wms.WMSLayer.class);142 //}143 114 144 115 public WMSLayer(String layerName, CacheFactory cacheFactory, … … 167 138 //log = LogFactory.getLog(org.geowebcache.layer.wms.WMSLayer.class); 168 139 } 169 170 // private void lazyLayerInitialization() {171 // width = 256;172 // height = 256;173 // version = "1.1.0";174 // transparent = true;175 // zoomStart = 0;176 // zoomStop = 20;177 // request = "GetMap";178 // errormime = ErrorMime.vnd_ogc_se_inimage.getMimeType();179 // curWmsURL = 0;180 // wmsLayers = "topp:states";181 // saveExpirationHeaders = false;182 // expireClients = GWCVars.CACHE_USE_WMS_BACKEND_VALUE;183 // expireCache = GWCVars.CACHE_NEVER_EXPIRE;184 // layerLock = new ReentrantLock();185 // layerLocked = false;186 // layerLockedCond = layerLock.newCondition();187 // procQueue = new HashMap<GridLocObj, Boolean>();188 // cacheLockWait = -1;189 // //initCacheFactory = cf;190 // }191 140 192 141 public Boolean isInitialized() { … … 204 153 205 154 protected Boolean initialize() { 206 207 //lazyLayerInitialization();208 155 log = LogFactory.getLog(org.geowebcache.layer.wms.WMSLayer.class); 209 156 curWmsURL = 0; … … 214 161 //width = 256; 215 162 //height = 256; 216 217 163 //request = "GetMap"; 164 218 165 errormime = ErrorMime.vnd_ogc_se_inimage.getMimeType(); 219 166 version = "1.1.0"; … … 226 173 procQueue = new HashMap<GridLocObj, Boolean>(); 227 174 228 229 175 try { 230 176 initParameters(); … … 258 204 * @return 259 205 */ 260 public Tile get Response(Tile tile) throws GeoWebCacheException, IOException {206 public Tile getTile(Tile tile) throws GeoWebCacheException, IOException { 261 207 MimeType mime = tile.getMimeType(); 262 208 … … 278 224 // Okay, so we need to go to the backend 279 225 if (mime.supportsTiling()) { 280 return getMetatilingReponse(tile );226 return getMetatilingReponse(tile, true); 281 227 } else { 282 return getNonMetatilingReponse(tile); 283 } 284 } 228 return getNonMetatilingReponse(tile, true); 229 } 230 } 231 232 233 /** 234 * Used for seeding 235 */ 236 public void seedTile(Tile tile, boolean tryCache) throws GeoWebCacheException, IOException { 237 if (tile.getMimeType().supportsTiling()) { 238 getMetatilingReponse(tile, tryCache); 239 } else { 240 getNonMetatilingReponse(tile, tryCache); 241 } 242 } 243 285 244 286 245 /** 287 246 * Metatiling request forwarding 288 247 * 289 * @param tileRequest 290 * @param gridLoc 291 * @param mime 292 * @param idx 293 * @param response 294 * @return 248 * @param tile the Tile with all the information 249 * @param tryCache whether to try the cache, or seed 295 250 * @throws GeoWebCacheException 296 251 */ 297 private Tile getMetatilingReponse(Tile tile ) throws GeoWebCacheException {298 252 private Tile getMetatilingReponse(Tile tile, boolean tryCache) 253 throws GeoWebCacheException { 299 254 //int idx = this.getSRSIndex(tile.getSRS()); 300 255 int[] gridLoc = tile.getTileIndex(); … … 318 273 try { 319 274 /** ****************** Check cache again ************** */ 320 if (tryCache Fetch(tile)) {275 if (tryCache && tryCacheFetch(tile)) { 321 276 // Someone got it already, return lock and we're done 322 277 removeFromQueue(metaGlo, condIdx); … … 370 325 * Non-metatiling forward to backend 371 326 * 372 * @param tileRequest 373 * @param gridLoc 374 * @param mime 375 * @param idx 376 * @param response 377 * @return 378 */ 379 private Tile getNonMetatilingReponse(Tile tile) throws GeoWebCacheException { 327 * @param tile the Tile with all the information 328 * @param tryCache whether to try the cache, or seed 329 * @throws GeoWebCacheException 330 */ 331 private Tile getNonMetatilingReponse(Tile tile, boolean tryCache) 332 throws GeoWebCacheException { 380 333 // String debugHeadersStr = null; 381 334 int[] gridLoc = tile.getTileIndex(); … … 387 340 try { 388 341 /** ****************** Check cache again ************** */ 389 if (tryCache Fetch(tile)) {342 if (tryCache && tryCacheFetch(tile)) { 390 343 // Someone got it already, return lock and we're done 391 344 removeFromQueue(glo, condIdx); -
trunk/geowebcache/src/main/java/org/geowebcache/rest/SeedTask.java
r369 r370 78 78 int TOTAL_TILES = tileCount(coveredGridLevels, zoomStart, zoomStop); 79 79 int count = 0; 80 boolean tryCache = !reseed; 80 81 81 82 for (int level = zoomStart; level <= zoomStop; level++) { … … 90 91 null, null); 91 92 try { 92 tl. getResponse(tile);93 tl.seedTile(tile, tryCache); 93 94 } catch (GeoWebCacheException e) { 94 95 e.printStackTrace(); -
trunk/geowebcache/src/main/java/org/geowebcache/service/kml/KMLDebugGridLayer.java
r340 r370 182 182 } 183 183 184 public Tile get Response(Tile tile)184 public Tile getTile(Tile tile) 185 185 throws GeoWebCacheException, IOException { 186 186 // TODO Auto-generated method stub … … 516 516 } 517 517 518 @Override 519 public void seedTile(Tile tile, boolean tryCache) 520 throws GeoWebCacheException, IOException { 521 // TODO Auto-generated method stub 522 523 } 524 518 525 } -
trunk/geowebcache/src/main/java/org/geowebcache/service/kml/KMLService.java
r359 r370 348 348 try { 349 349 tile.setWrapperMimeType(null); 350 tileLayer.get Response(tile);350 tileLayer.getTile(tile); 351 351 tile.setWrapperMimeType(XMLMime.kmz); 352 352 } catch (IOException ioe) { -
trunk/geowebcache/src/main/java/org/geowebcache/service/kml/KMZHelper.java
r337 r370 72 72 73 73 try { 74 tileLayer.get Response(tile);74 tileLayer.getTile(tile); 75 75 76 76 } catch (IOException ioe) {
