public void handleGlobalChange( GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { if (propertyNames.contains("coverageAccess")) { // Make sure to proceed with coverageAccess init // only in case the global change involved that section initCoverage(global.getCoverageAccess()); } }
@Override public void handleGlobalChange( GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { int i = propertyNames.indexOf("featureTypeCacheSize"); if (i > -1) { Number featureTypeCacheSize = (Number) newValues.get(i); gs.getCatalog() .getResourcePool() .setFeatureTypeCacheSize(featureTypeCacheSize.intValue()); } gs.getCatalog() .getResourcePool() .setCoverageExecutor( global.getCoverageAccess().getThreadPoolExecutor()); } });
public void initialize(GeoServer geoServer) throws Exception { this.gs = geoServer; final GeoServerInfo geoserverInfo = geoServer.getGlobal(); CoverageAccessInfo coverageAccess = geoserverInfo.getCoverageAccess(); if (coverageAccess == null) { coverageAccess = new CoverageAccessInfoImpl(); geoserverInfo.setCoverageAccess(coverageAccess); } initCoverage(coverageAccess); geoServer.addListener( new ConfigurationListenerAdapter() { public void handleGlobalChange( GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { if (propertyNames.contains("coverageAccess")) { // Make sure to proceed with coverageAccess init // only in case the global change involved that section initCoverage(global.getCoverageAccess()); } } @Override public void handlePostGlobalChange(GeoServerInfo global) { // No need to handle that change too } }); }
public IModel<CoverageAccessInfo> getCoverageAccessModel(){ // Notes setup on top of an explanation provided by Gabriel Roldan for // his patch which fixes the modificationProxy unable to detect changes // -------------------------------------------------------------------- // with this change, we will edit a clone of the original Info. // By this way, the modification proxy will count it as a change. // The previous code wasn't working as expected. // the reason is that the model used to edit the page is a // LoadableDetachableModel, so when the edit page does gobal.setJAI, it // is actually setting the same object reference, and hence the // modificationProxy does not count it as a change. CoverageAccessInfo currCoverageAccessInfo = getGeoServerApplication().getGeoServer().getGlobal().getCoverageAccess().clone(); return new Model<CoverageAccessInfo>(currCoverageAccessInfo); }
public IModel<CoverageAccessInfo> getCoverageAccessModel() { // Notes setup on top of an explanation provided by Gabriel Roldan for // his patch which fixes the modificationProxy unable to detect changes // -------------------------------------------------------------------- // with this change, we will edit a clone of the original Info. // By this way, the modification proxy will count it as a change. // The previous code wasn't working as expected. // the reason is that the model used to edit the page is a // LoadableDetachableModel, so when the edit page does gobal.setJAI, it // is actually setting the same object reference, and hence the // modificationProxy does not count it as a change. CoverageAccessInfo currCoverageAccessInfo = getGeoServerApplication().getGeoServer().getGlobal().getCoverageAccess().clone(); return new Model<CoverageAccessInfo>(currCoverageAccessInfo); }
JAIInfo jaiInfo = geoServerInfo.getJAI(); JAI jai = jaiInfo.getJAI(); CoverageAccessInfo coverageAccess = geoServerInfo.getCoverageAccess(); TileCache jaiCache = jaiInfo.getTileCache();
final CoverageAccessInfo info = geoServer.getGlobal().getCoverageAccess();
final CoverageAccessInfo info = geoServer.getGlobal().getCoverageAccess();
JAIInfo jaiInfo = geoServerInfo.getJAI(); JAI jai = jaiInfo.getJAI(); CoverageAccessInfo coverageAccess = geoServerInfo.getCoverageAccess(); TileCache jaiCache = jaiInfo.getTileCache();
ContactInfo contactInfo = settingsInfo.getContact(); JAIInfo jaiInfo = info.getJAI(); CoverageAccessInfo covInfo = info.getCoverageAccess(); properties.put("contactPerson", contactInfo.getContactPerson() != null ? contactInfo.getContactPerson()
deserGeoServerInfo.getCoverageAccess()));
deserGeoServerInfo.getCoverageAccess()));
@Before public void init() { geoServer = getGeoServer(); // revert global settings GeoServerInfo global = getGeoServer().getGlobal(); global.getJAI().setAllowInterpolation(false); global.getJAI().setMemoryThreshold(0.75d); global.getJAI().setTilePriority(5); global.getCoverageAccess().setQueueType(CoverageAccessInfo.QueueType.UNBOUNDED); getGeoServer().save(global); revertSettings(null); // revert local settings revertSettings("sf"); }