Package net.sf.toxicity

Examples of net.sf.toxicity.Pipeline


    private void process() { }
   
    @Around("process()")
    private Document process(ProceedingJoinPoint pjp) throws Throwable {
       
        Pipeline p = (Pipeline)pjp.getTarget();
        Document d = (Document)pjp.getArgs()[0];
       
        MimeType mt = p.getClass().getAnnotation(MimeType.class);
        if(mt != null) {
            String mimeType = mt.value();
            log.debug("Specified document mime type: " + mimeType);
            mLastMimeType.set(mt.value());
        } else {
View Full Code Here


    private void process() { }
   
    @Around("process()")
    private Document cache(ProceedingJoinPoint pjp) throws Throwable {
       
        Pipeline p = (Pipeline)pjp.getTarget();
        Document d = (Document)pjp.getArgs()[0];
       
        // check if current pipeline is cachable - abort on negative result
        Cachable cb = p.getClass().getAnnotation(Cachable.class);
        if(cb == null) {
            log.debug("Pipeline not cachable. Aborting.");
            mLastModified.set(-1L);
            mNoCache.set(true);
            return (Document)pjp.proceed();
View Full Code Here

    private Document trace(ProceedingJoinPoint pjp) {
       
        try {
            Document pIn = (Document)pjp.getArgs()[0];
            Document pOut = (Document)pjp.proceed();
            Pipeline pipeline = (Pipeline)pjp.getTarget();
           
            StackTraceElement el = new StackTraceElement(pipeline, pIn, pOut);
            mStackTrace.get().add(el);
           
            return pOut;
View Full Code Here

            log.debug("Response mime type: " + responseWrapper.getContentType());
            Document id = responseWrapper.getPage();
            log.debug("Got document from filter chain: " + id);
           
            // get initial pipeline and pass the request to it
            Pipeline pipeline = getInitialPipeline();
            if(pipeline == null)
                throw new NullPointerException("Initial pipeline must be set "
                        + "before invoking toxicity!");
           
            if(id != null) {

                Document is = pipeline.process(id);
                //Boolean noCache = CachingAspect.getNoCache();
                //if(noCache == null || noCache.booleanValue()) {
                    responseWrapper.setHeader("Cache-Control", "no-cache");
                    responseWrapper.setHeader("Pragma", "no-cache");
                    responseWrapper.setDateHeader("Last-Modified", System.currentTimeMillis());
View Full Code Here

        }
       
        List<StackTraceElement> ste = DebugAspect.getStackTraceElements();
        if(ste != null) {
            for(StackTraceElement el : ste) {
                Pipeline p = el.getPipelne();
                writer.print("<p><b>" + p.getClass().getName() + "</b></p>");
               
            }
        }
       
        writer.print("</body>\n</html>\n");
View Full Code Here

TOP

Related Classes of net.sf.toxicity.Pipeline

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.