void initCoverage(CoverageAccessInfo coverageAccess) { if (coverageAccess != null) { ThreadPoolExecutor executor = coverageAccess.getThreadPoolExecutor(); coverageAccess.getCorePoolSize(), coverageAccess.getMaxPoolSize(), coverageAccess.getKeepAliveTime(), TimeUnit.MILLISECONDS, coverageAccess.getQueueType() == QueueType.UNBOUNDED ? new LinkedBlockingQueue<Runnable>() : new SynchronousQueue<Runnable>()); coverageAccess.setThreadPoolExecutor(executor); } else { final QueueType queueType = coverageAccess.getQueueType(); executor.setCorePoolSize(coverageAccess.getCorePoolSize()); executor.setMaximumPoolSize(coverageAccess.getMaxPoolSize()); executor.setKeepAliveTime( coverageAccess.getKeepAliveTime(), TimeUnit.MILLISECONDS); coverageAccess.setThreadPoolExecutor(executor); } else { coverageAccess.getCorePoolSize(), coverageAccess.getMaxPoolSize(), coverageAccess.getKeepAliveTime(), TimeUnit.MILLISECONDS, coverageAccess.getQueueType() == QueueType.DIRECT ? new SynchronousQueue<Runnable>() : new LinkedBlockingQueue<Runnable>());
.getPriority())); values.put(KEY_COVERAGEACCESS_CORE_POOL_SIZE, Integer.toString(coverageAccess.getCorePoolSize())); values.put(KEY_COVERAGEACCESS_MAX_POOL_SIZE, Integer.toString(coverageAccess.getMaxPoolSize())); values.put(KEY_COVERAGEACCESS_KEEP_ALIVE_TIME, Integer.toString(coverageAccess.getKeepAliveTime()));
properties.put("allowNativeMosaic", jaiInfo.isAllowNativeMosaic() ? "true" : "false"); properties.put("maxPoolSize", String.valueOf(covInfo.getMaxPoolSize())); properties.put("corePoolSize", String.valueOf(covInfo.getCorePoolSize())); properties.put("keepAliveTime", String.valueOf(covInfo.getKeepAliveTime())); properties.put("queueType", covInfo.getQueueType()); properties.put("imageIOCacheThreshold", String.valueOf(covInfo.getImageIOCacheThreshold()));
final ThreadPoolExecutor executor = info.getThreadPoolExecutor(); info.setThreadPoolExecutor(executor);
@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 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); }
Integer.toString(coverageAccess.getCorePoolSize())); values.put( KEY_COVERAGEACCESS_MAX_POOL_SIZE, Integer.toString(coverageAccess.getMaxPoolSize())); values.put( KEY_COVERAGEACCESS_KEEP_ALIVE_TIME, Integer.toString(coverageAccess.getKeepAliveTime()));
final ThreadPoolExecutor executor = info.getThreadPoolExecutor(); info.setThreadPoolExecutor(executor);
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); }