Package com.volantis.mcs.runtime.policies.cache

Examples of com.volantis.mcs.runtime.policies.cache.CacheControlConstraints


                    configuration.getLocation(), groupBuilder);

            // Create the base constraints for the partition. These will
            // be used to derive the constraints for the type specific
            // partitions.
            CacheControlConstraints base =
                    new CacheControlConstraints(
                            partitionConstraints.getConstraints(),
                            partitionConfiguration);

            builder.setCacheControlDefaults(base.getDefaultCacheControl());

            SeparateCacheControlConstraintsMap constraintsMap =
                    new SeparateCacheControlConstraintsMap();
            for (Iterator i = PolicyType.getPolicyTypes().iterator(); i.hasNext();) {
                PolicyType policyType = (PolicyType) i.next();
                PolicyTypePartitionConfiguration typePartitionConfiguration =
                        partition.getTypePartition(policyType);
                CacheControlConstraints typeConstraints;
                groupBuilder = cacheFactory.createGroupBuilder();
                if (typePartitionConfiguration == null) {
                    typeConstraints = base;
                    groupBuilder.setMaxCount(partitionSize);
                } else {
                    RemotePolicyCacheConfiguration typeConfiguration =
                            typePartitionConfiguration.getConstraints();
                    if (typeConfiguration == null) {
                        typeConstraints = base;
                    } else {
                        typeConstraints = new CacheControlConstraints(base,
                                typeConfiguration);
                    }
                    groupBuilder.setMaxCount(typePartitionConfiguration.getSize());
                }
                partitionGroup.addGroup(policyType, groupBuilder);
View Full Code Here


        // Activate the cache control
        PolicyType policyType = policyBuilder.getPolicyType();
        CacheControlConstraintsMap constraintsMap =
                logicalProject.getCacheControlConstraintsMap();
        CacheControlConstraints constraints = constraintsMap.getConstraints(
                policyType);

        // Get the cache control builder from the policy.
        CacheControlBuilder cacheControlBuilder =
                policyBuilder.getCacheControlBuilder();
        if (cacheControlBuilder == null) {
            // No builder was set so use a default builder.
            cacheControlBuilder = constraints.getDefaultCacheControl()
                    .getCacheControlBuilder();
            policyBuilder.setCacheControlBuilder(cacheControlBuilder);
        } else {
            constraints.applyConstraints(cacheControlBuilder);
        }

        return activateImpl(actualProject, policyBuilder, logicalProject);
    }
View Full Code Here

            PolicyActivator activator,
            final String name,
            final VariablePolicyType policyType,
            final VariantType variantType) {

        CacheControlConstraints constraints =
                CacheControlConstraints.getDefaultConstraints();
        CacheControlConstraintsMap constraintsMap =
                new SingleCacheControlConstraintsMap(constraints);

        MockFactory factory = MockFactory.getDefaultInstance();
View Full Code Here

            if (IMDRepositoryEnabled) {
                logger.info("using-imd-repository");
            }

            CacheControlConstraints defaultRemoteCacheControlConstraints =
                    createRemoteCacheControlConstraints();

            // Create the policy cache.
            PolicyCache policyCache = createPolicyCache(
                    defaultRemoteCacheControlConstraints);
View Full Code Here

                if (timeout == null || timeout.intValue() == -1) {
                    timeout = INTEGER_MAX_VALUE;
                }
            }

            CacheControlConstraints constraints = createLocalCacheConstraints(
                    allowCacheThisPolicy, timeout);

            map.addConstraints(policyType, constraints);
        }
View Full Code Here

        cacheConfiguration.setDefaultRetryInterval(INTEGER_ZERO);
        cacheConfiguration.setDefaultRetryMaxCount(INTEGER_MAX_VALUE);
        cacheConfiguration.setDefaultRetainDuringRetry(Boolean.TRUE);

        cacheConfiguration.setDefaultTimeToLive(timeout);
        CacheControlConstraints constraints = new CacheControlConstraints(
                cacheConfiguration);
        return constraints;
    }
View Full Code Here

        Integer maxTimeToLive = policyCacheConfiguration.getMaxTimeToLive();
        if (maxTimeToLive != null && maxTimeToLive.intValue() == 0) {
            policyCacheConfiguration.setMaxTimeToLive(INTEGER_MAX_VALUE);
        }

        CacheControlConstraints constraints = new CacheControlConstraints(
                policyCacheConfiguration);
        return constraints;
    }
View Full Code Here

                DEFAULT_REMOTE_GROUP_SIZE);

        PolicyCacheBuilder builder = new PolicyCacheBuilder(
                localSize, remoteSize);

        CacheControlConstraints localConstraints = createLocalCacheConstraints(
                Boolean.TRUE, null);

        PolicyCachePartitionConstraints localPartitionConstraints =
                createPartitionConstraints(localSize, localConstraints);
View Full Code Here

        RemotePolicyCacheConfiguration configuration =
                new RemotePolicyCacheConfiguration();
        configuration.setMaxTimeToLive(new Integer(200));
        configuration.setDefaultRetryInterval(new Integer(2));

        constraints = new CacheControlConstraints(configuration);

        PolicyCachePartitionConstraints partitionConstraints =
                new PolicyCachePartitionConstraintsImpl(50, 60, constraints);

        builder.setLocalPartitionConstraints(partitionConstraints);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.runtime.policies.cache.CacheControlConstraints

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.