public void handleGlobalChange( GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { if (propertyNames.contains( "jAI")) { // TODO: check why the propertyname is reported as jAI // instead of JAI // Make sure to proceed with JAI init // only in case the global change involved that section initJAI(global.getJAI()); } } });
public void initialize(GeoServer geoServer) throws Exception { initJAI(geoServer.getGlobal().getJAI()); geoServer.addListener( new ConfigurationListenerAdapter() { public void handleGlobalChange( GeoServerInfo global, List<String> propertyNames, List<Object> oldValues, List<Object> newValues) { if (propertyNames.contains( "jAI")) { // TODO: check why the propertyname is reported as jAI // instead of JAI // Make sure to proceed with JAI init // only in case the global change involved that section initJAI(global.getJAI()); } } }); }
private JAIInfo getJaiInfo() { GeoServer geoServer = getGeoServer(); GeoServerInfo global = geoServer.getGlobal(); return global.getJAI(); }
public IModel<JAIInfo> getJAIModel() { // 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 JAIInfo. // 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 JAIInfo 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. JAIInfo currJaiInfo = getGeoServerApplication().getGeoServer().getGlobal().getJAI().clone(); return new Model<JAIInfo>(currJaiInfo); }
public IModel<JAIInfo> getJAIModel(){ // 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 JAIInfo. // 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 JAIInfo 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. JAIInfo currJaiInfo = getGeoServerApplication().getGeoServer().getGlobal().getJAI().clone(); return new Model<JAIInfo>(currJaiInfo); }
public void onClick() { TileCache jaiCache = getGeoServer().getGlobal().getJAI().getTileCache(); final long capacityBefore = jaiCache.getMemoryCapacity(); jaiCache.flush(); jaiCache.setMemoryCapacity(0); // to be sure we realease all tiles System.gc(); System.runFinalization(); jaiCache.setMemoryCapacity(capacityBefore); updateModel(); } });
JAIInfo jaiInfo = geoServerInfo.getJAI(); JAI jai = jaiInfo.getJAI(); CoverageAccessInfo coverageAccess = geoServerInfo.getCoverageAccess();
public void onClick() { TileCache jaiCache = parent.getGeoServer().getGlobal().getJAI().getTileCache(); final long capacityBefore = jaiCache.getMemoryCapacity(); jaiCache.flush(); jaiCache.setMemoryCapacity(0); // to be sure we realease all tiles System.gc(); System.runFinalization(); jaiCache.setMemoryCapacity(capacityBefore); updateModel(); } });
/** * Return the local JAIInfo updating its member with the ones coming from the passed JAIInfo * * @param geoServer the local GeoServer instance * @param deserInfo the de-serialized JAIInfo instance * @return the updated and local JAIInfo * * @throws IllegalAccessException {@link BeanUtilsBean.copyProperties} * @throws InvocationTargetException {@link BeanUtilsBean.copyProperties} * @throws IllegalArgumentException if arguments are null */ private static JAIInfo localizeJAIInfo(final GeoServer geoServer, final JAIInfo deserInfo) throws IllegalAccessException, InvocationTargetException { if (geoServer == null || deserInfo == null) throw new IllegalArgumentException("Wrong passed arguments are null"); // get local instance final JAIInfo info = geoServer.getGlobal().getJAI(); // temporarily store tyleCache reference final TileCache sunTyleCache = info.getTileCache(); // overwrite all members BeanUtils.copyProperties(info, deserInfo); // set tyle cache using stored reference info.setTileCache(sunTyleCache); return info; }
/** * Return the local JAIInfo updating its member with the ones coming from the passed JAIInfo * * @param geoServer the local GeoServer instance * @param deserInfo the de-serialized JAIInfo instance * @return the updated and local JAIInfo * * @throws IllegalAccessException {@link BeanUtilsBean.copyProperties} * @throws InvocationTargetException {@link BeanUtilsBean.copyProperties} * @throws IllegalArgumentException if arguments are null */ private static JAIInfo localizeJAIInfo(final GeoServer geoServer, final JAIInfo deserInfo) throws IllegalAccessException, InvocationTargetException { if (geoServer == null || deserInfo == null) throw new IllegalArgumentException("Wrong passed arguments are null"); // get local instance final JAIInfo info = geoServer.getGlobal().getJAI(); // temporarily store tyleCache reference final TileCache sunTyleCache = info.getTileCache(); // overwrite all members BeanUtils.copyProperties(info, deserInfo); // set tyle cache using stored reference info.setTileCache(sunTyleCache); return info; }
JAIInfo jaiInfo = geoServerInfo.getJAI(); JAI jai = jaiInfo.getJAI(); CoverageAccessInfo coverageAccess = geoServerInfo.getCoverageAccess();
SettingsInfo settingsInfo = info.getSettings(); ContactInfo contactInfo = settingsInfo.getContact(); JAIInfo jaiInfo = info.getJAI(); CoverageAccessInfo covInfo = info.getCoverageAccess(); properties.put("contactPerson",
@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"); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { // PNGJ has bugs with band selected data, fall back on JDK super.onSetUp(testData); GeoServer gs = getGeoServer(); GeoServerInfo gsInfo = gs.getGlobal(); gsInfo.getJAI().setPngEncoderType(PngEncoderType.JDK); gs.save(gsInfo); }
localObject.setJAI(localizeJAIInfo(geoServer, deserGeoServerInfo.getJAI()));
localObject.setJAI(localizeJAIInfo(geoServer, deserGeoServerInfo.getJAI()));