/** * {@inheritDoc} * * @see org.apache.cocoon.pipeline.Pipeline#setup(java.io.OutputStream, * java.util.Map) */ public void setup(OutputStream outputStream, Map<String, Object> parameters) { if (outputStream == null) { throw new SetupException("An output stream must be passed."); } this.setupComponents(outputStream, parameters); this.setupDone = true; }
@Override public void setup(OutputStream outputStream, Map<String, Object> parameters) { // create a caching output stream to intercept the result this.cachingOutputStream = new CachingOutputStream(outputStream); super.setup(this.cachingOutputStream, parameters); this.cacheKey = this.constructCacheKey(); }
public NodeGenerator(Node document) { if (document == null) { throw new SetupException("A DOM document has to be passed."); } this.node = document; }
/** * {@inheritDoc} * * @see org.apache.cocoon.pipeline.Pipeline#execute() */ public void execute() throws Exception { if (!this.setupDone) { throw new ProcessingException(new IllegalStateException( "The pipeline wasn't setup correctly. Call #setup() first.")); } this.invokeStarter(); }
public void execute() { try { this.saxBeanWriter.write(this.bean); } catch (IOException e) { throw new ProcessingException("Fatal protocol violation", e); } catch (SAXException e) { throw new ProcessingException("Fatal XML error", e); } catch (IntrospectionException e) { throw new ProcessingException("Impossible to analyze input bean", e); } }
/** * {@inheritDoc} */ public static <PC extends PipelineComponent> LinkedPipelineStarterBuilder<PC> newCachingPipeline() { return newPipeline(new CachingPipeline<PC>()); }
/** * {@inheritDoc} */ public static <PC extends PipelineComponent> LinkedPipelineStarterBuilder<PC> newNonCachingPipeline() { return newPipeline(new NonCachingPipeline<PC>()); }
/** * {@inheritDoc} */ public static LinkedSAXPipelineStarterBuilder newNonCachingPipeline() { return newPipeline(new NonCachingPipeline<SAXPipelineComponent>()); }
/** * {@inheritDoc} */ public static LinkedSAXPipelineStarterBuilder newAsyncCachePipeline() { return newPipeline(new AsyncCachePipeline<SAXPipelineComponent>()); }
/** * {@inheritDoc} * * @see org.apache.cocoon.pipeline.Pipeline#setup(java.io.OutputStream, * java.util.Map) */ public void setup(OutputStream outputStream) { this.setup(outputStream, null); }
/** * {@inheritDoc} * * @see org.apache.cocoon.pipeline.AbstractPipeline#setConfiguration(java.util.Map) */ @Override public void setConfiguration(Map<String, ? extends Object> parameters) { this.expires = (String) parameters.get("expires"); this.expiresCacheKey = (Serializable) parameters.get("expires-cache-key"); this.jmxGroupName = (String) parameters.get("jmx-group-name"); super.setConfiguration(parameters); }
public InputStreamGenerator(InputStream inputStream) { super(); if (inputStream == null) { throw new SetupException("An input stream has to be passed."); } this.inputStream = inputStream; }
public SAXBufferGenerator(SAXBuffer saxBuffer) { super(); if (saxBuffer == null) { throw new SetupException("A SAXBuffer has to be passed."); } this.saxBuffer = saxBuffer; }
public XMLSerializer(Properties format) { super(); if (format == null) { throw new SetupException("No format properites passed as argument."); } this.format = format; }
public ByteArrayGenerator(byte[] bytes, String encoding) { if (bytes == null) { throw new SetupException("A byte array has to be passed."); } this.bytes = bytes; this.encoding = encoding; }
public FileGenerator(File file) { if (file == null) { throw new SetupException("A file has to be passed."); } this.file = file; }
public StringGenerator(String xmlString) { super(); if (xmlString == null) { throw new SetupException("An XML string has to be passed."); } this.xmlString = xmlString; }
/** * Constructs an Wrapper around an SAXTransformer and made it available to add it to an * {@link Pipeline} only containing StAX- {@link PipelineComponent}s. * * @param The Transformer which should be wrapped. As an SAXTransformer it have to implement the * {@link SAXProducer} and the {@link SAXConsumer} interface. Since no transformer * interface exists at the moment at the cocoon-sax project this way is chosen. But * this may be changed later. */ public SAXForStAXPipelineWrapper(SAXProducer saxTransformer) { // check if component is the right one if (!(saxTransformer instanceof SAXConsumer)) { throw new SetupException("SAX component does not fulfill all preconditions."); } this.saxTransformer = saxTransformer; }
/** * {@inheritDoc} * * @see org.apache.cocoon.pipeline.component.Producer#setConsumer(org.apache.cocoon.pipeline.component.Consumer) */ public final void setConsumer(Consumer consumer) { if (!(consumer instanceof SAXConsumer)) { throw new SetupException("SAXProducer requires a SAXConsumer."); } this.setSAXConsumer((SAXConsumer) consumer); }
@Override public void setOutputStream(OutputStream outputStream) { try { super.setOutputStream(outputStream); } catch (IOException e) { throw new SetupException(e); } }