Package org.geoserver.config

Examples of org.geoserver.config.JAIInfo


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


       
        values.put(KEY_JAI_AVAILABLE, Boolean.toString(isNativeJAIAvailable()));
        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 {
View Full Code Here

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

import com.sun.media.jai.opimage.WarpRIF;

public class JAIPageTest extends GeoServerWicketTestSupport {
    @Test
    public void testValues() {
        JAIInfo info = (JAIInfo) getGeoServerApplication()
            .getGeoServer()
            .getGlobal().getJAI();

        login();

        tester.startPage(JAIPage.class);
        tester.assertComponent("form:tileThreads", TextField.class);
        tester.assertModelValue("form:tileThreads", info.getTileThreads());
    }
View Full Code Here

        if(!ImageUtilities.isMediaLibAvailable()){
            // If medialib acceleration is not available, the test is not needed
            Assert.assertTrue(true);
            return;
        }
        JAIInfo info = (JAIInfo) getGeoServerApplication()
                .getGeoServer()
                .getGlobal().getJAI();
       
        // Ensure that by default Warp acceleration is set to false
        Assert.assertFalse(info.isAllowNativeWarp());
       
        login();
        // Ensure the page is rendered
        tester.startPage(JAIPage.class);
        tester.assertRenderedPage(JAIPage.class);
       
        // Set Native Warp enabled
        FormTester form = tester.newFormTester("form");
        form.setValue("allowNativeWarp", true);
        form.submit("submit");
       
        // Ensure no exception has been thrown
        tester.assertNoErrorMessage();
       
        info = (JAIInfo) getGeoServerApplication()
                .getGeoServer()
                .getGlobal().getJAI();
       
        // Check that Warp is enabled
        Assert.assertTrue(info.isAllowNativeWarp());
       
        // Ensure the factory is correctly registered
        Object factory = info.getJAI().getOperationRegistry().getFactory(RenderedRegistryMode.MODE_NAME, "Warp");
        Assert.assertTrue(factory instanceof MlibWarpRIF);
       
        // Unset Native Warp enabled
       
        // Render the page again
        tester.startPage(JAIPage.class);
        tester.assertRenderedPage(JAIPage.class);
       
        form = tester.newFormTester("form");
        form.setValue("allowNativeWarp", false);
        form.submit("submit");
       
        // Ensure no exception has been thrown
        tester.assertNoErrorMessage();
       
        info = (JAIInfo) getGeoServerApplication()
                .getGeoServer()
                .getGlobal().getJAI();
       
        // Check that Warp is enabled
        Assert.assertFalse(info.isAllowNativeWarp());
       
        // Ensure the factory is correctly registered
        factory = info.getJAI().getOperationRegistry().getFactory(RenderedRegistryMode.MODE_NAME, "Warp");
        Assert.assertTrue(factory instanceof WarpRIF);
    }
View Full Code Here

    public WMSInterpolation getInterpolation() {
        return getServiceInfo().getInterpolation();
    }

    public JAIInfo.PngEncoderType getPNGEncoderType() {
        JAIInfo jaiInfo = getJaiInfo();
        return jaiInfo.getPngEncoderType();
    }
View Full Code Here

        JAIInfo jaiInfo = getJaiInfo();
        return jaiInfo.getPngEncoderType();
    }

    public Boolean getJPEGNativeAcceleration() {
        JAIInfo jaiInfo = getJaiInfo();
        return Boolean.valueOf(jaiInfo.isJpegAcceleration());
    }
View Full Code Here

            cfg.setObjectWrapper(new ObjectToMapWrapper<GeoServerInfo>(GeoServerInfo.class) {
                @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());
View Full Code Here

    public WMSInterpolation getInterpolation() {
        return getServiceInfo().getInterpolation();
    }

    public Boolean getPNGNativeAcceleration() {
        JAIInfo jaiInfo = getJaiInfo();
        return Boolean.valueOf(jaiInfo.isPngAcceleration());
    }
View Full Code Here

        JAIInfo jaiInfo = getJaiInfo();
        return Boolean.valueOf(jaiInfo.isPngAcceleration());
    }

    public Boolean getJPEGNativeAcceleration() {
        JAIInfo jaiInfo = getJaiInfo();
        return Boolean.valueOf(jaiInfo.isJpegAcceleration());
    }
View Full Code Here

TOP

Related Classes of org.geoserver.config.JAIInfo

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.