test_class.declarator: layer
test_class.modifier: @Autowired
  	@Qualifier("tmsLayer")
  	private
test_class.original_string: @Autowired
  	@Qualifier("tmsLayer")
  	private TmsLayer layer;
test_class.type: TmsLayer
test_class.var_name: layer
test_class.declarator: layerWithBadUrl
test_class.modifier: @Autowired
  	@Qualifier("tmsLayerWithBadUrl")
  	private
test_class.original_string: @Autowired
  	@Qualifier("tmsLayerWithBadUrl")
  	private TmsLayer layerWithBadUrl;
test_class.type: TmsLayer
test_class.var_name: layerWithBadUrl
test_class.declarator: proxyLayer
test_class.modifier: @Autowired
  	@Qualifier("tmsLayerProxy")
  	private
test_class.original_string: @Autowired
  	@Qualifier("tmsLayerProxy")
  	private TmsLayer proxyLayer;
test_class.type: TmsLayer
test_class.var_name: proxyLayer
test_class.declarator: geoService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private GeoService geoService;
test_class.type: GeoService
test_class.var_name: geoService
test_class.file: plugin/layer-tms/tms/src/test/java/org/geomajas/layer/tms/TmsLayerTest.java
test_class.identifier: TmsLayerTest
test_case.body: @Test
  	public void testRetryInit() throws LayerException, GeomajasException, InterruptedException {
  		// context is loaded but layer in unusable state
  		Assert.assertFalse(layerWithBadUrl.isUsable());
  		// check that unusable layer throws at us
  		Envelope maxBounds = new Envelope(18000.0, 259500.250, 152999.75, 244500.0);
  		try {
  			layerWithBadUrl.paint(geoService.getCrs("EPSG:31370"), maxBounds, 1.0 / 1024.0);
  			Assert.fail("Unusable layer should throw exception on painting");
  		} catch (Exception e) {
  		}
  		// set a perfectly good url to simulate server is up again
  		layerWithBadUrl.setBaseTmsUrl("classpath:/org/geomajas/layer/tms/tileMapCapa2.xml");
  		Assert.assertFalse(layerWithBadUrl.isUsable());
  		// wait a second
  		Thread.sleep(1000);
  		// this will now retry init !!!
  		layerWithBadUrl.paint(geoService.getCrs("EPSG:31370"), maxBounds, 1.0 / 1024.0);
  		Assert.assertTrue(layerWithBadUrl.isUsable());				
  	}
test_case.class_method_signature: TmsLayerTest.testRetryInit()
test_case.full_signature: @Test public void testRetryInit()
test_case.identifier: testRetryInit
test_case.invocations: assertFalse isUsable paint getCrs fail setBaseTmsUrl assertFalse isUsable sleep paint getCrs assertTrue isUsable
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRetryInit()
focal_class.declarator: DEFAULT_COOLDOWN_TIME = 60000
focal_class.modifier: private static final
focal_class.original_string: private static final long DEFAULT_COOLDOWN_TIME = 60000;
focal_class.type: long
focal_class.var_name: DEFAULT_COOLDOWN_TIME
focal_class.declarator: UNUSABLE_LAYER_INFO = new RasterLayerInfo()
focal_class.modifier: private static final
focal_class.original_string: private static final RasterLayerInfo UNUSABLE_LAYER_INFO = new RasterLayerInfo();
focal_class.type: RasterLayerInfo
focal_class.var_name: UNUSABLE_LAYER_INFO
focal_class.declarator: log = LoggerFactory.getLogger(TmsLayer.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger log = LoggerFactory.getLogger(TmsLayer.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: id
focal_class.modifier: private
focal_class.original_string: private String id;
focal_class.type: String
focal_class.var_name: id
focal_class.declarator: baseTmsUrl
focal_class.modifier: private
focal_class.original_string: private String baseTmsUrl;
focal_class.type: String
focal_class.var_name: baseTmsUrl
focal_class.declarator: extension = "jpg"
focal_class.modifier: private
focal_class.original_string: private String extension = "jpg";
focal_class.type: String
focal_class.var_name: extension
focal_class.declarator: version = "1.0.0"
focal_class.modifier: private
focal_class.original_string: private String version = "1.0.0";
focal_class.type: String
focal_class.var_name: version
focal_class.declarator: tileMap
focal_class.modifier: private
focal_class.original_string: private TileMap tileMap;
focal_class.type: TileMap
focal_class.var_name: tileMap
focal_class.declarator: layerInfo
focal_class.modifier: private
focal_class.original_string: private RasterLayerInfo layerInfo;
focal_class.type: RasterLayerInfo
focal_class.var_name: layerInfo
focal_class.declarator: authentication
focal_class.modifier: private
focal_class.original_string: private LayerAuthentication authentication;
focal_class.type: LayerAuthentication
focal_class.var_name: authentication
focal_class.declarator: useProxy
focal_class.modifier: private
focal_class.original_string: private boolean useProxy;
focal_class.type: boolean
focal_class.var_name: useProxy
focal_class.declarator: useCache
focal_class.modifier: private
focal_class.original_string: private boolean useCache;
focal_class.type: boolean
focal_class.var_name: useCache
focal_class.declarator: usable
focal_class.modifier: private
focal_class.original_string: private boolean usable;
focal_class.type: boolean
focal_class.var_name: usable
focal_class.declarator: lastInitRetry
focal_class.modifier: private
focal_class.original_string: private long lastInitRetry;
focal_class.type: long
focal_class.var_name: lastInitRetry
focal_class.declarator: cooldownTimeBetweenInitializationRetries = DEFAULT_COOLDOWN_TIME
focal_class.modifier: private
focal_class.original_string: private long cooldownTimeBetweenInitializationRetries = DEFAULT_COOLDOWN_TIME;
focal_class.type: long
focal_class.var_name: cooldownTimeBetweenInitializationRetries
focal_class.declarator: geoService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private GeoService geoService;
focal_class.type: GeoService
focal_class.var_name: geoService
focal_class.declarator: configurationService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private TmsConfigurationService configurationService;
focal_class.type: TmsConfigurationService
focal_class.var_name: configurationService
focal_class.declarator: dispatcherUrlService
focal_class.modifier: @Autowired(required = false)
  	private
focal_class.original_string: @Autowired(required = false)
  	private DispatcherUrlService dispatcherUrlService;
focal_class.type: DispatcherUrlService
focal_class.var_name: dispatcherUrlService
focal_class.declarator: cacheManagerService
focal_class.modifier: @Autowired(required = false)
  	private
focal_class.original_string: @Autowired(required = false)
  	private CacheManagerService cacheManagerService;
focal_class.type: CacheManagerService
focal_class.var_name: cacheManagerService
focal_class.declarator: securityContext
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private SecurityContext securityContext;
focal_class.type: SecurityContext
focal_class.var_name: securityContext
focal_class.declarator: tileService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private TileService tileService;
focal_class.type: TileService
focal_class.var_name: tileService
focal_class.declarator: state
focal_class.modifier: private
focal_class.original_string: private TileServiceState state;
focal_class.type: TileServiceState
focal_class.var_name: state
focal_class.declarator: urlBuilder
focal_class.modifier: private
focal_class.original_string: private TileUrlBuilder urlBuilder;
focal_class.type: TileUrlBuilder
focal_class.var_name: urlBuilder
focal_class.file: plugin/layer-tms/tms/src/main/java/org/geomajas/layer/tms/TmsLayer.java
focal_class.identifier: TmsLayer
focal_class.interfaces: implements RasterLayer, ProxyLayerSupport
focal_class.class_method_signature: TmsLayer.postConstruct()
focal_class.full_signature: @PostConstruct protected void postConstruct()
focal_class.identifier: postConstruct
focal_class.modifiers: @PostConstruct protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void postConstruct()
focal_class.class_method_signature: TmsLayer.getLayerInfo()
focal_class.full_signature: @Override public RasterLayerInfo getLayerInfo()
focal_class.identifier: getLayerInfo
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: RasterLayerInfo
focal_class.signature: RasterLayerInfo getLayerInfo()
focal_class.class_method_signature: TmsLayer.getCrs()
focal_class.full_signature: @Override public CoordinateReferenceSystem getCrs()
focal_class.identifier: getCrs
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: CoordinateReferenceSystem
focal_class.signature: CoordinateReferenceSystem getCrs()
focal_class.class_method_signature: TmsLayer.getId()
focal_class.full_signature: @Override public String getId()
focal_class.identifier: getId
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getId()
focal_class.class_method_signature: TmsLayer.setCooldownTimeBetweenInitializationRetries(long cooldownTimeBetweenInitializationRetries)
focal_class.full_signature: @Api public void setCooldownTimeBetweenInitializationRetries(long cooldownTimeBetweenInitializationRetries)
focal_class.identifier: setCooldownTimeBetweenInitializationRetries
focal_class.modifiers: @Api public
focal_class.parameters: (long cooldownTimeBetweenInitializationRetries)
focal_class.return: void
focal_class.signature: void setCooldownTimeBetweenInitializationRetries(long cooldownTimeBetweenInitializationRetries)
focal_class.class_method_signature: TmsLayer.paint(CoordinateReferenceSystem boundsCrs, Envelope bounds, double scale)
focal_class.full_signature: @Override public List<RasterTile> paint(CoordinateReferenceSystem boundsCrs, Envelope bounds, double scale)
focal_class.identifier: paint
focal_class.modifiers: @Override public
focal_class.parameters: (CoordinateReferenceSystem boundsCrs, Envelope bounds, double scale)
focal_class.return: List<RasterTile>
focal_class.signature: List<RasterTile> paint(CoordinateReferenceSystem boundsCrs, Envelope bounds, double scale)
focal_class.class_method_signature: TmsLayer.isUsable()
focal_class.full_signature: protected boolean isUsable()
focal_class.identifier: isUsable
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isUsable()
focal_class.class_method_signature: TmsLayer.retryInit()
focal_class.full_signature: private void retryInit()
focal_class.identifier: retryInit
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void retryInit()
focal_class.class_method_signature: TmsLayer.getTmsTargetUrl()
focal_class.full_signature: private String getTmsTargetUrl()
focal_class.identifier: getTmsTargetUrl
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getTmsTargetUrl()
focal_class.class_method_signature: TmsLayer.formatUrl(String imageUrl)
focal_class.full_signature: private String formatUrl(String imageUrl)
focal_class.identifier: formatUrl
focal_class.modifiers: private
focal_class.parameters: (String imageUrl)
focal_class.return: String
focal_class.signature: String formatUrl(String imageUrl)
focal_class.class_method_signature: TmsLayer.setLayerInfo(RasterLayerInfo layerInfo)
focal_class.full_signature: public void setLayerInfo(RasterLayerInfo layerInfo)
focal_class.identifier: setLayerInfo
focal_class.modifiers: public
focal_class.parameters: (RasterLayerInfo layerInfo)
focal_class.return: void
focal_class.signature: void setLayerInfo(RasterLayerInfo layerInfo)
focal_class.class_method_signature: TmsLayer.setId(String id)
focal_class.full_signature: public void setId(String id)
focal_class.identifier: setId
focal_class.modifiers: public
focal_class.parameters: (String id)
focal_class.return: void
focal_class.signature: void setId(String id)
focal_class.class_method_signature: TmsLayer.getBaseTmsUrl()
focal_class.full_signature: public String getBaseTmsUrl()
focal_class.identifier: getBaseTmsUrl
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getBaseTmsUrl()
focal_class.class_method_signature: TmsLayer.setBaseTmsUrl(String baseTmsUrl)
focal_class.full_signature: @Api public void setBaseTmsUrl(String baseTmsUrl)
focal_class.identifier: setBaseTmsUrl
focal_class.modifiers: @Api public
focal_class.parameters: (String baseTmsUrl)
focal_class.return: void
focal_class.signature: void setBaseTmsUrl(String baseTmsUrl)
focal_class.class_method_signature: TmsLayer.getExtension()
focal_class.full_signature: public String getExtension()
focal_class.identifier: getExtension
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getExtension()
focal_class.class_method_signature: TmsLayer.setExtension(String extension)
focal_class.full_signature: @Api public void setExtension(String extension)
focal_class.identifier: setExtension
focal_class.modifiers: @Api public
focal_class.parameters: (String extension)
focal_class.return: void
focal_class.signature: void setExtension(String extension)
focal_class.class_method_signature: TmsLayer.getVersion()
focal_class.full_signature: public String getVersion()
focal_class.identifier: getVersion
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getVersion()
focal_class.class_method_signature: TmsLayer.setVersion(String version)
focal_class.full_signature: public void setVersion(String version)
focal_class.identifier: setVersion
focal_class.modifiers: public
focal_class.parameters: (String version)
focal_class.return: void
focal_class.signature: void setVersion(String version)
focal_class.class_method_signature: TmsLayer.getAuthentication()
focal_class.full_signature: public LayerAuthentication getAuthentication()
focal_class.identifier: getAuthentication
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: LayerAuthentication
focal_class.signature: LayerAuthentication getAuthentication()
focal_class.class_method_signature: TmsLayer.setAuthentication(LayerAuthentication authentication)
focal_class.full_signature: @Api public void setAuthentication(LayerAuthentication authentication)
focal_class.identifier: setAuthentication
focal_class.modifiers: @Api public
focal_class.parameters: (LayerAuthentication authentication)
focal_class.return: void
focal_class.signature: void setAuthentication(LayerAuthentication authentication)
focal_class.class_method_signature: TmsLayer.setUseProxy(boolean useProxy)
focal_class.full_signature: @Api public void setUseProxy(boolean useProxy)
focal_class.identifier: setUseProxy
focal_class.modifiers: @Api public
focal_class.parameters: (boolean useProxy)
focal_class.return: void
focal_class.signature: void setUseProxy(boolean useProxy)
focal_class.class_method_signature: TmsLayer.setUseCache(boolean useCache)
focal_class.full_signature: @Api public void setUseCache(boolean useCache)
focal_class.identifier: setUseCache
focal_class.modifiers: @Api public
focal_class.parameters: (boolean useCache)
focal_class.return: void
focal_class.signature: void setUseCache(boolean useCache)
focal_class.class_method_signature: TmsLayer.getProxyAuthentication()
focal_class.full_signature: @Override public ProxyAuthentication getProxyAuthentication()
focal_class.identifier: getProxyAuthentication
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ProxyAuthentication
focal_class.signature: ProxyAuthentication getProxyAuthentication()
focal_class.class_method_signature: TmsLayer.isUseCache()
focal_class.full_signature: @Api public boolean isUseCache()
focal_class.identifier: isUseCache
focal_class.modifiers: @Api public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isUseCache()
focal_class.class_method_signature: TmsLayer.getTileMap()
focal_class.full_signature: public TileMap getTileMap()
focal_class.identifier: getTileMap
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TileMap
focal_class.signature: TileMap getTileMap()
focal_method.body: private void retryInit() throws GeomajasException {
  		// do not hammer the service
  		long now = System.currentTimeMillis();
  		if (now > lastInitRetry + cooldownTimeBetweenInitializationRetries) {
  			lastInitRetry = now;
  			try {
  				log.debug("Retrying to (re-)initialize layer {}", getId());
  				postConstruct();
  			} catch (Exception e) { // NOSONAR
  				log.warn("Failed initializing layer: ", e.getMessage());
  			}
  		}
  		if (!usable) {
  			throw new GeomajasException(ExceptionCode.LAYER_CONFIGURATION_PROBLEM);
  		}
  	}
focal_method.class_method_signature: TmsLayer.retryInit()
focal_method.full_signature: private void retryInit()
focal_method.identifier: retryInit
focal_method.invocations: currentTimeMillis debug getId postConstruct warn getMessage
focal_method.modifiers: private
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void retryInit()