Examples of PolicyFactory


Examples of com.volantis.mcs.policies.PolicyFactory

            addPage(pages[i]);
        }
    }

    protected List getCategories() {
        PolicyFactory policyFactory = PolicyFactory.getDefaultInstance();

        PolicyEditorContext context = (PolicyEditorContext)getContext();

        List categories = new ArrayList();
        List categoryValues = context.getCategoryValues();
        if (categoryValues != null && !categoryValues.isEmpty()) {
            Iterator it = categoryValues.iterator();
            while (it.hasNext()) {
                String value = (String) it.next();
                CategoryReference categoryRef =
                        policyFactory.createCategoryReference(value);
                categories.add(categoryRef);
            }
        }
        return categories;
    }
View Full Code Here

Examples of com.volantis.mcs.policies.PolicyFactory

        // Set the Layout (needed for FormatReference and panes)
        CanvasLayout layout = new CanvasLayout();

        // Don't actual resolve anything as it requires repository connections,
        // branding information, etc.
        PolicyFactory factory = PolicyFactory.getDefaultInstance();
        RolloverImagePolicyBuilder rolloverBuilder =
                factory.createRolloverImagePolicyBuilder();
        rolloverBuilder.setName("Test rollover response");
        rolloverBuilder.setNormalPolicy(factory.createPolicyReference("Normal",
                PolicyType.IMAGE));
        rolloverBuilder.setOverPolicy(factory.createPolicyReference("Over",
                PolicyType.IMAGE));
        //pageContext.setRollover(rollover);

        // Intitialise the context
        pageContext.pushRequestContext(requestContext);
View Full Code Here

Examples of com.volantis.mcs.policies.PolicyFactory

            = ContextInternals.getMarinerPageContext (mrc);
       
        pageContext.pushIMDAPIElement(this);

        // Create the base URL builder.
        PolicyFactory factory = PolicyFactory.getDefaultInstance();
        BaseURLPolicyBuilder builder = factory.createBaseURLPolicyBuilder();
        builder.setName(attrs.getName());

        String locationTypeAsString = attrs.getLocationType();
        BaseLocation baseLocation = getBaseLocation(locationTypeAsString);
        builder.setBaseLocation(baseLocation);
View Full Code Here

Examples of com.volantis.mcs.policies.PolicyFactory

        }
    }

    public boolean perform(final PolicyBuilderManager manager) {

        final PolicyFactory factory = PolicyFactory.getDefaultInstance();

        FileEx sourceDirEx = new FileEx(sourceDirectory);
        sourceDirEx.forEachDirectory(new FileExOperation() {
            public void perform(File policyDir) {

                try {
                    logger.info("processing-policy",
                            policyDir.getName());

                    // Figure out the location of the component.
                    String policyName = policyDir.getName() + "." +
                            FileExtension.IMAGE_COMPONENT.getExtension();

                    if (componentNamePrefix != null) {
                        policyName = componentNamePrefix + policyName;
                    }

                    // Create the component, if any.
                    VariablePolicyBuilder policyBuilder = (VariablePolicyBuilder)
                            manager.getPolicyBuilder(policyName);

                    // Check to see whether the existing container should
                    // be updated, or a new one created.
                    boolean update = (policyBuilder != null && replace);
                    if (policyBuilder != null) {
                        if (replace) {

                            // ... then remove it
                            logger.info("removing-existing", policyName);

                            manager.removePolicyBuilder(policyName);
                        } else {
                            // ... else all we can do is log a warning.
                            logger.info("found-existing-ignoring-new",
                                        new Object[] {policyName});
                        }
                    }

                    if (policyBuilder == null) {
                        policyBuilder = factory.createVariablePolicyBuilder(
                                PolicyType.IMAGE);
                        policyBuilder.setName(policyName);
                        update = false;
                    } else {
                        update = true;
View Full Code Here

Examples of com.volantis.mcs.policies.PolicyFactory

        this.defaultMinRetryInterval = DEFAULT_MIN_RETRY_INTERVAL;
        this.defaultAllowRetainDuringRetry = DEFAULT_ALLOW_RETAIN_DURING_RETRY;
        this.defaultMaxRetryMaxCount = DEFAULT_MAX_RETRY_MAX_COUNT;

        // Set up the default cache control.
        PolicyFactory factory = PolicyFactory.getDefaultInstance();

        CacheControlBuilder builder = factory.createCacheControlBuilder();
        builder.setCacheThisPolicy(DEFAULT_CACHE_THIS_POLICY);
        builder.setRetainDuringRetry(DEFAULT_RETAIN_DURING_RETRY);
        builder.setRetryFailedRetrieval(DEFAULT_RETRY_FAILED_RETRIEVAL);
        builder.setRetryInterval(DEFAULT_RETRY_INTERVAL);
        builder.setRetryMaxCount(DEFAULT_RETRY_MAX_COUNT);
View Full Code Here

Examples of com.volantis.mcs.policies.PolicyFactory

            maxRetryMaxCount = 0;
        }

        // Create the default CacheControlBuilder.
        PolicyFactory factory = PolicyFactory.getDefaultInstance();

        CacheControl baseCacheControl = base.getDefaultCacheControl();

        CacheControlBuilder builder = factory.createCacheControlBuilder();
        builder.setCacheThisPolicy(getBoolean(
                configuration.getDefaultCacheThisPolicy(),
                baseCacheControl.getCacheThisPolicy()));
        builder.setRetainDuringRetry(getBoolean(
                configuration.getDefaultRetainDuringRetry(),
View Full Code Here

Examples of com.volantis.mcs.policies.PolicyFactory

            final boolean cacheThisPolicy, final boolean retainDuringRetry,
            final boolean retryFailedRetrieval,
            final int retryInterval,
            final int retryMaxCount,
            final int timeToLive) {
        PolicyFactory factory = PolicyFactory.getDefaultInstance();
        CacheControlBuilder builder = factory.createCacheControlBuilder();
        builder.setCacheThisPolicy(cacheThisPolicy);
        builder.setRetainDuringRetry(retainDuringRetry);
        builder.setRetryFailedRetrieval(retryFailedRetrieval);
        builder.setRetryInterval(retryInterval);
        builder.setRetryMaxCount(retryMaxCount);
View Full Code Here

Examples of com.volantis.mcs.policies.PolicyFactory

public class RuntimeVariablePolicyTestCase
        extends TestCaseAbstract {

    public void testDeviceTargeted() {

        PolicyFactory factory = PolicyFactory.getDefaultInstance();

       
        // todo
    }
View Full Code Here

Examples of org.apache.tuscany.sca.policy.PolicyFactory

        // Create SCA assembly and SCA Java factories
        ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint();
        AssemblyFactory assemblyFactory = new BeanAssemblyFactory(new DefaultAssemblyFactory(), beanFactory);
        modelFactories.addFactory(assemblyFactory);
        SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
        PolicyFactory policyFactory = new DefaultPolicyFactory();
        modelFactories.addFactory(policyFactory);
        ContributionFactory contributionFactory = modelFactories.getFactory(ContributionFactory.class);
        InterfaceContractMapper interfaceContractMapper = new InterfaceContractMapperImpl();
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
        modelFactories.addFactory(javaFactory);
View Full Code Here

Examples of org.apache.tuscany.sca.policy.PolicyFactory

                if (processorDeclaration.getClassName()
                    .equals("org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor")) {

                    // Specific initialization for the DefaultBeanModelProcessor
                    AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
                    PolicyFactory policyFactory = modelFactories.getFactory(PolicyFactory.class);
                    try {
                        Class<StAXArtifactProcessor> processorClass =
                            (Class<StAXArtifactProcessor>)processorDeclaration.loadClass();
                        Object modelFactory;
                        if (factoryName != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.