Project

General

Profile

« Previous | Next » 

Revision 5311

Added by daigle about 14 years ago

Merge 1.9.2 changes back into the trunk

View differences:

MetaCatServlet.java
61 61
import edu.ucsb.nceas.metacat.shared.HandlerException;
62 62
import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
63 63
import edu.ucsb.nceas.metacat.shared.ServiceException;
64
import edu.ucsb.nceas.metacat.spatial.SpatialFeatureSchema;
65 64
import edu.ucsb.nceas.metacat.spatial.SpatialHarvester;
66 65
import edu.ucsb.nceas.metacat.util.AuthUtil;
67 66
import edu.ucsb.nceas.metacat.util.ConfigurationUtil;
......
336 335
			logMetacat.debug("MetaCatServlet.initSecondHalf - DBConnection pool initialized: " + connPool.toString());
337 336
			
338 337
			ServiceService.registerService("XMLSchemaService", XMLSchemaService.getInstance());
339
//			ServiceService.registerService("SchedulerService", SchedulerService.getInstance());
340 338

  
341 339
			// check if eml201 document were corrected or not. if not, correct eml201 documents.
342 340
			// Before Metacat 1.8.1, metacat uses tag RELEASE_EML_2_0_1_UPDATE_6 as eml
......
374 372
			 * If spatial option is turned on and set to regenerate the spatial
375 373
			 * cache on restart, trigger the harvester regeneratation method
376 374
			 */
377
			if (PropertyService.getProperty("spatial.runSpatialOption").equals("true")) {
378
			//      && PropertyService.getProperty("spatial.regenerateCacheOnRestart").equals("true")) {
379
			        
375
			if (PropertyService.getProperty("spatial.runSpatialOption").equals("true") && 
376
					PropertyService.getProperty("spatial.regenerateCacheOnRestart").equals("true")) {
377

  
380 378
				// Begin timer
381 379
				long before = System.currentTimeMillis();
382 380

  
383
                // if either the point or polygon shape files do not exist, then regenerate the entire spatial cache
384
                // this may be expensive with many documents
385
                if (FileUtil.getFileStatus(SpatialFeatureSchema.pointShpUri) == FileUtil.DOES_NOT_EXIST) {      
386
                    SpatialHarvester sh = new SpatialHarvester();
387
                    sh.regenerate();
388
                    sh.destroy();
389
                }
381
				// if either the point or polygon shape files do not exist, then regenerate the entire spatial cache
382
				// this may be expensive with many documents		
383
				SpatialHarvester sh = new SpatialHarvester();
384
				sh.regenerate();
385
				sh.destroy();
390 386

  
391 387
				// After running the first time, we want to to set
392 388
				// regenerateCacheOnRestart to false
393 389
				// so that it does not regenerate the cache every time tomcat is
394 390
				// restarted
395
//				PropertyService.setProperty("spatial.regenerateCacheOnRestart", "false");
391
				PropertyService.setProperty("spatial.regenerateCacheOnRestart", "false");
396 392

  
397 393
				// End timer
398 394
				long after = System.currentTimeMillis();
......
420 416
			System.setProperty("replication.logfile.name", replicationLogPath);			
421 417
			PropertyConfigurator.configureAndWatch(LOG_CONFIG_NAME);
422 418
			
419
			SessionService.unRegisterAllSessions();
420
			
423 421
	         //Initialize Metacat Handler
424 422
            handler = new MetacatHandler(getServletContext(), timer);
425 423

  
426
			MetacatHandler.set_sitemapScheduled(false);
424
			handler.set_sitemapScheduled(false);
427 425

  
428 426
			_fullyInitialized = true;
429 427
			

Also available in: Unified diff