1 16 package org.apache.cocoon.sitemap; 17 18 import org.apache.cocoon.components.treeprocessor.InvokeContext; 19 import org.apache.cocoon.components.treeprocessor.sitemap.ErrorHandlerHelper; 20 import org.apache.cocoon.components.pipeline.ProcessingPipeline; 21 import org.apache.cocoon.environment.Environment; 22 23 30 public class SitemapErrorHandler { 31 34 private ErrorHandlerHelper handler; 35 36 39 private Environment environment; 40 41 44 private InvokeContext context; 45 46 private String envPrefix; 48 private String envURI; 49 private String envContext; 50 51 54 public SitemapErrorHandler(ErrorHandlerHelper handler, 55 Environment environment, 56 InvokeContext context) { 57 this.handler = handler; 58 this.environment = environment; 59 this.context = context; 60 61 this.envPrefix = environment.getURIPrefix(); 62 this.envURI = environment.getURI(); 63 this.envContext = environment.getContext(); 64 } 65 66 70 public boolean handleError(Exception e) throws Exception { 71 this.environment.setContext(this.envPrefix, this.envURI, this.envContext); 73 74 return this.handler.invokeErrorHandler(e, this.environment, this.context); 75 } 76 77 81 public ProcessingPipeline prepareErrorPipeline(Exception e) throws Exception { 82 this.environment.setContext(this.envPrefix, this.envURI, this.envContext); 84 85 return this.handler.prepareErrorHandler(e, this.environment, this.context); 86 } 87 } 88 | Popular Tags |