@ PostConstruct protected void postConstruct ( ) throws GeomajasException { if ( null == baseTmsUrl ) { throw new GeomajasException ( ExceptionCode . PARAMETER_MISSING , "baseTmsUrl" ) ; } // Make sure we have a base URL we can work with: if ( ( baseTmsUrl . startsWith ( "http://" ) || baseTmsUrl . startsWith ( "https://" ) ) && ! baseTmsUrl . endsWith ( "/" ) ) { baseTmsUrl += "/" ; } // Make sure there is a correct RasterLayerInfo object: if ( layerInfo == null || layerInfo == UNUSABLE_LAYER_INFO ) { try { tileMap = configurationService . getCapabilities ( this ) ; version = tileMap . getVersion ( ) ; extension = tileMap . getTileFormat ( ) . getExtension ( ) ; layerInfo = configurationService . asLayerInfo ( tileMap ) ; usable = true ; } catch ( TmsLayerException e ) { // a layer needs an info object to keep the DtoConfigurationPostProcessor happy ! layerInfo = UNUSABLE_LAYER_INFO ; usable = false ; log . warn ( "The layer could not be correctly initialized: " + getId ( ) , e ) ; } } else if ( extension == null ) { throw new GeomajasException ( ExceptionCode . PARAMETER_MISSING , "extension" ) ; } if ( layerInfo != null ) { // Finally prepare some often needed values: state = new TileServiceState ( geoService , layerInfo ) ; // when proxying the real url will be resolved later on, just use a simple one for now boolean proxying = useCache || useProxy || null != authentication ; if ( tileMap != null && ! proxying ) { urlBuilder = new TileMapUrlBuilder ( tileMap ) ; } else { urlBuilder = new SimpleTmsUrlBuilder ( extension ) ; } } }
Finish initializing the service .