Package org.geoserver.config

Examples of org.geoserver.config.CoverageAccessInfo


    GeoServer gs;

    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);
View Full Code Here


        values.put(KEY_JAI_IMAGEIO_AVAILABLE, Boolean.toString(PackageUtil.isCodecLibAvailable()));

        GeoServerInfo geoServerInfo = getGeoServer().getGlobal();
        JAIInfo jaiInfo = geoServerInfo.getJAI();
        JAI jai =  jaiInfo.getJAI();
        CoverageAccessInfo coverageAccess = geoServerInfo.getCoverageAccess();
        SunTileCache jaiCache = jaiInfo.getTileCache();

        values.put(KEY_JAI_MAX_MEM, formatMemory(jaiCache.getMemoryCapacity()));
        values.put(KEY_JAI_MEM_USAGE, formatMemory(jaiCache.getCacheMemoryUsed()));
        values.put(KEY_JAI_MEM_THRESHOLD, Float.toString(100.0f * jaiCache.getMemoryThreshold()));
        values.put(KEY_JAI_TILE_THREADS, Integer.toString(jai.getTileScheduler().getParallelism()));
        values.put(KEY_JAI_TILE_THREAD_PRIORITY, Integer.toString(jai.getTileScheduler()
                .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()));

        values.put(KEY_UPDATE_SEQUENCE, Long.toString(geoServerInfo.getUpdateSequence()));
    }
View Full Code Here

    GeoServer gs;

    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);
View Full Code Here

            InvocationTargetException {
        if (geoServer == null || deserInfo == null)
            throw new IllegalArgumentException("Wrong passed arguments are null");

        // get local instance
        final CoverageAccessInfo info = geoServer.getGlobal().getCoverageAccess();

        // store local reference
        final ThreadPoolExecutor executor = info.getThreadPoolExecutor();

        // overwrite all members
        BeanUtils.copyProperties(info, deserInfo);

        // set thread pool using stored reference
        info.setThreadPoolExecutor(executor);

        return info;
    }
View Full Code Here

        values.put(KEY_JAI_IMAGEIO_AVAILABLE, Boolean.toString(PackageUtil.isCodecLibAvailable()));

        GeoServerInfo geoServerInfo = getGeoServer().getGlobal();
        JAIInfo jaiInfo = geoServerInfo.getJAI();
        JAI jai =  jaiInfo.getJAI();
        CoverageAccessInfo coverageAccess = geoServerInfo.getCoverageAccess();
        TileCache jaiCache = jaiInfo.getTileCache();

        values.put(KEY_JAI_MAX_MEM, formatMemory(jaiCache.getMemoryCapacity()));
        if(jaiCache instanceof CacheDiagnostics) {
            values.put(KEY_JAI_MEM_USAGE, formatMemory(((CacheDiagnostics) jaiCache).getCacheMemoryUsed()));
        } else {
            values.put(KEY_JAI_MEM_USAGE, "-");
        }
        values.put(KEY_JAI_MEM_THRESHOLD, Float.toString(100.0f * jaiCache.getMemoryThreshold()));
        values.put(KEY_JAI_TILE_THREADS, Integer.toString(jai.getTileScheduler().getParallelism()));
        values.put(KEY_JAI_TILE_THREAD_PRIORITY, Integer.toString(jai.getTileScheduler()
                .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()));

        values.put(KEY_UPDATE_SEQUENCE, Long.toString(geoServerInfo.getUpdateSequence()));
    }
View Full Code Here

        // 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);
    }
View Full Code Here

                @Override
                protected void wrapInternal(Map properties, SimpleHash model, GeoServerInfo info) {
                    SettingsInfo settingsInfo = info.getSettings();
                    ContactInfo contactInfo = settingsInfo.getContact();
                    JAIInfo jaiInfo = info.getJAI();
                    CoverageAccessInfo covInfo = info.getCoverageAccess();
                    properties.put("contactPerson",
                            contactInfo.getContactPerson() != null ? contactInfo.getContactPerson()
                                    : "");
                    properties.put(
                            "contactOrganization",
                            contactInfo.getContactOrganization() != null ? contactInfo
                                    .getContactOrganization() : "");
                    properties.put(
                            "contactPosition",
                            contactInfo.getContactPosition() != null ? contactInfo
                                    .getContactPosition() : "");
                    properties.put("addressType",
                            contactInfo.getAddressType() != null ? contactInfo.getAddressType()
                                    : "");
                    properties.put("address",
                            contactInfo.getAddress() != null ? contactInfo.getAddress() : "");
                    properties.put("addressCity",
                            contactInfo.getAddressCity() != null ? contactInfo.getAddressCity()
                                    : "");
                    properties.put("addressState",
                            contactInfo.getAddressState() != null ? contactInfo.getAddressState()
                                    : "");
                    properties.put(
                            "addressPostalCode",
                            contactInfo.getAddressPostalCode() != null ? contactInfo
                                    .getAddressPostalCode() : "");
                    properties.put(
                            "addressCountry",
                            contactInfo.getAddressCountry() != null ? contactInfo
                                    .getAddressCountry() : "");
                    properties.put("contactVoice",
                            contactInfo.getContactVoice() != null ? contactInfo.getContactVoice()
                                    : "");
                    properties.put(
                            "contactFacsimile",
                            contactInfo.getContactFacsimile() != null ? contactInfo
                                    .getContactFacsimile() : "");
                    properties.put("contactEmail",
                            contactInfo.getContactEmail() != null ? contactInfo.getContactEmail()
                                    : "");
                    properties.put("verbose", settingsInfo.isVerbose() ? "true" : "false");
                    properties.put("verboseExceptions", settingsInfo.isVerboseExceptions() ? "true"
                            : "false");
                    properties.put("numDecimals", String.valueOf(settingsInfo.getNumDecimals()));
                    properties.put("charset", settingsInfo.getCharset());
                    properties.put(
                            "onlineResource",
                            settingsInfo.getOnlineResource() != null ? settingsInfo
                                    .getOnlineResource() : "");
                    properties.put("proxyBaseUrl",
                            settingsInfo.getProxyBaseUrl() != null ? settingsInfo.getProxyBaseUrl()
                                    : "");
                    properties.put("allowInterpolation", jaiInfo.getAllowInterpolation() ? "true"
                            : "false");
                    properties.put("recycling", jaiInfo.isRecycling() ? "true" : "false");
                    properties.put("tilePriority", String.valueOf(jaiInfo.getTilePriority()));
                    properties.put("tileThreads", String.valueOf(jaiInfo.getTileThreads()));
                    properties.put("memoryCapacity", jaiInfo.getMemoryCapacity());
                    properties.put("memoryThreshold", jaiInfo.getMemoryThreshold());
                    properties.put("imageIOCache", jaiInfo.isImageIOCache() ? "true" : "false");
                    properties.put("pngEncoderType", jaiInfo.getPngEncoderType().toString());
                    properties.put("jpegAcceleration", jaiInfo.isJpegAcceleration() ? "true"
                            : "false");
                    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()));
                }
            });
            return cfg;
        }
View Full Code Here

TOP

Related Classes of org.geoserver.config.CoverageAccessInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.