Examples of DependencyContext


Examples of com.volantis.shared.dependency.DependencyContext

//        objects = this.expressionContext.getObjectStack();
//        properties = new RecoverableComplexPropertyContainer();

        tracker = new TransactionTracker();

        DependencyContext dependencyContext =
                expressionContext.getDependencyContext();
        dependencyContext.setProperty(XMLPipelineContext.class, this);
    }
View Full Code Here

Examples of com.volantis.shared.dependency.DependencyContext

        return min;
    }

    public Freshness freshness(DependencyContext context) {

        DependencyContext internal =
                context;

        Freshness aggregate = Freshness.FRESH;
        for (int i = 0; i < dependencies.length &&
                aggregate != Freshness.STALE; i++) {

            Dependency dependency = dependencies[i];

            // Make sure that the dependency updates the revalidation list
            // correctly.
            Freshness freshness = internal.checkFreshness(dependency);
            aggregate = aggregate.combine(freshness);
        }

        return aggregate;
    }
View Full Code Here

Examples of com.volantis.shared.dependency.DependencyContext

            }
        }

        try {
            // Add the dependency information for this value to the pipeline.
            DependencyContext dependencyContext =
                    context.getDependencyContext();
            dependencyContext.addDependency(dependency);

            XMLProcess process;

            // Select the process to which the content should be sent based
            // on whether it needs to be processed through the dynamic pipeline
View Full Code Here

Examples of com.volantis.shared.dependency.DependencyContext

            if (requestType.equals(HTTPRequestType.GET) &&
                canRequestBeSatisfiedByCache(requestHeaders)) {
                // try to read it from the dependency context first
                HttpContent content = null;
                if (xmlPipelineContext != null) {
                    final DependencyContext dependencyContext =
                        xmlPipelineContext.getDependencyContext();
                    if (dependencyContext != null) {
                        content = (HttpContent)
                            dependencyContext.removeProperty(keyUrl);
                    }
                }
                if (content == null) {
                    try {
                        // This path requests the page through the cache.
                        content = (HttpContent) cache.retrieve(keyUrl,
                            new HttpCacheableObjectProvider(
                                executor, cache.getRootGroup(), cache));
                    } catch (RuntimeHttpException e) {
                        throw (HTTPException) e.getCause();
                    }
                }
                respAccessor = new HttpContentWrapper(content);
                dependency = content.getDependency();
            } else {
                // This path is for the types of request whose response should
                // not be cached. POST and currently anything that is not
                // a GET. We delegate directly to the target
                // AbstractPluggableHTTPManager to get the data.
                respAccessor = executor.execute();

                dependency = UncacheableDependency.getInstance();
            }
        }
        if (xmlPipelineContext != null) {
            final DependencyContext dependencyContext =
                xmlPipelineContext.getDependencyContext();
            if (dependencyContext != null &&
                    dependencyContext.isTrackingDependencies()) {
                dependencyContext.addDependency(dependency);
            }
        }
        return respAccessor;
    }
View Full Code Here

Examples of com.volantis.shared.dependency.DependencyContext

                }

                try {
                    HttpStatusCode statusCode = httpClient.executeMethod(method);
                    if (xmlPipelineContext != null) {
                        final DependencyContext dependencyContext =
                            xmlPipelineContext.getDependencyContext();
                        if (dependencyContext != null &&
                                dependencyContext.isTrackingDependencies()) {
                            dependencyContext.addDependency(
                                UncacheableDependency.getInstance());
                        }
                    }
                    return new HTTPClientResponseAccessor(method, statusCode);
                } catch (IOException e) {
View Full Code Here

Examples of com.volantis.shared.dependency.DependencyContext

            // InputSource. The XMLReader will need this in order to
            // resolve relative URIs
            source.setSystemId(inclusionSystemId);

            // add dependency to the dependency context
            final DependencyContext dependencyContext =
                context.getDependencyContext();
            if (dependencyContext != null &&
                dependencyContext.isTrackingDependencies()) {

                dependencyContext.addDependency(content.getDependency());
            }

            // perform the inclusion
            reader.parse(source);
View Full Code Here

Examples of com.volantis.shared.dependency.DependencyContext

                    // pass the characters down the XML pipeline
                    target.characters(chars, 0, charsRead);
                }
            }
            // add dependency to the dependency context
            final DependencyContext dependencyContext =
                context.getDependencyContext();
            if (dependencyContext != null &&
                dependencyContext.isTrackingDependencies()) {

                dependencyContext.addDependency(content.getDependency());
            }
        } catch (UnsupportedEncodingException uee) {
            // get hold of the current locator
            Locator currentLocator =
                    context.getCurrentLocator();
View Full Code Here

Examples of com.volantis.shared.dependency.DependencyContext

            throws IOException {
        HttpContent httpContent = null;
        // check the dependency context first as the dependency might stored
        // the content there on a revalidate
        if (httpConfig != null) {
            final DependencyContext dependencyContext =
                httpConfig.getDependencyContext();
            if (dependencyContext != null) {
                httpContent = (HttpContent)
                    dependencyContext.removeProperty(url);
            }
        }
        if (httpContent == null) {
            try {
                httpContent = (HttpContent) cache.retrieve(url,
View Full Code Here

Examples of com.volantis.shared.dependency.DependencyContext

        XMLPipelineContext pipelineContext = dynamicProcess.getPipelineContext();

        String value = attributes.getValue("ignore");
        final boolean ignoring = "true".equalsIgnoreCase(value);

        DependencyContext context = pipelineContext.getDependencyContext();

        context.pushDependencyTracker(ignoring ? Tracking.DISABLED : Tracking.ENABLED);

        return null;
    }
View Full Code Here

Examples of com.volantis.shared.dependency.DependencyContext

    public void endElement(
            DynamicProcess dynamicProcess, ExpandedName element, Object object)
            throws SAXException {

        XMLPipelineContext pipelineContext = dynamicProcess.getPipelineContext();
        DependencyContext context = pipelineContext.getDependencyContext();

        Dependency dependency = context.extractDependency();

        context.popDependencyTracker();

        XMLProcess target = getTargetProcess(dynamicProcess);

        // Generate an element containing the freshness.
        Freshness freshness = dependency.freshness(context);
        generateSimpleElement(target, freshness.toString(),
                "freshness");

        // Generate an element containing the revalidated freshness.
        if (freshness == Freshness.REVALIDATE) {
            Freshness revalidated = dependency.revalidate(context);
            generateSimpleElement(target, revalidated.toString(),
                    "revalidated");
        }

        Cacheability cacheability = dependency.getCacheability();
        generateSimpleElement(target, cacheability.toString(), "cacheability");

        Period timeToLive = dependency.getTimeToLive();
        generateSimpleElement(target, timeToLive.toString(), "time-to-live");

        Validity validity = context.checkValidity(dependency);
        generateSimpleElement(target, validity.toString(), "validity");
    }
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.