Examples of Processor


Examples of org.apache.camel.Processor

                    .doCatch(Exception.class)
                        .to("mock:catch")
                    .end();

                from("direct:bar")
                    .process(new Processor() {
                        @Override
                        public void process(Exchange exchange) throws Exception {
                            String body = exchange.getIn().getBody(String.class);
                            if (body.contains("Kaboom")) {
                                throw new IllegalArgumentException("Forced error");
View Full Code Here

Examples of org.apache.camel.Processor

             */
            failures.set(0);
            callback.done(true);
            return true;
        }
        Processor processor = getProcessors().get(0);
        if (processor == null) {
            throw new IllegalStateException("No processors could be chosen to process CircuitBreaker");
        }

        AsyncProcessor albp = AsyncProcessorConverterHelper.convert(processor);
View Full Code Here

Examples of org.apache.cocoon.Processor

        this.hasRedirected = true;
    }

    private void cocoonRedirect(boolean sessionMode, String uri)
    throws IOException, ProcessingException {
        Processor actualProcessor = null;
        try {
            boolean rawMode = false;
            String prefix;

            // remove the protocol
            int protocolEnd = uri.indexOf(':');
            if (protocolEnd != -1) {
                uri = uri.substring(protocolEnd + 1);
                // check for subprotocol
                if (uri.startsWith("raw:")) {
                    uri = uri.substring(4);
                    rawMode = true;
                }
            }

            Processor usedProcessor;

            // Does the uri point to this sitemap or to the root sitemap?
            if (uri.startsWith("//")) {
                uri = uri.substring(2);
                prefix = ""; // start at the root
                try {
                    actualProcessor = (Processor)this.manager.lookup(Processor.ROLE);
                    usedProcessor = actualProcessor;
                } catch (ComponentException e) {
                    throw new ProcessingException("Cannot get Processor instance", e);
                }

            } else if (uri.startsWith("/")) {
                prefix = null; // means use current prefix
                uri = uri.substring(1);
                usedProcessor = this.processor;

            } else {
                throw new ProcessingException("Malformed cocoon URI.");
            }

            // create the queryString (if available)
            String queryString = null;
            int queryStringPos = uri.indexOf('?');
            if (queryStringPos != -1) {
                queryString = uri.substring(queryStringPos + 1);
                uri = uri.substring(0, queryStringPos);
            }

            // build the request uri which is relative to the context
            String requestURI = (prefix == null ? env.getURIPrefix() + uri : uri);

            ForwardEnvironmentWrapper newEnv =
                new ForwardEnvironmentWrapper(env, requestURI, queryString, getLogger(), rawMode);
            newEnv.setURI(prefix, uri);

            boolean processingResult;

            // FIXME - What to do here?
            Object processKey = CocoonComponentManager.startProcessing(newEnv);
            try {
               
                if ( !this.internal ) {
                    processingResult = usedProcessor.process(newEnv);
                } else {
                    ProcessingPipeline pp = usedProcessor.processInternal(newEnv);
                    if (pp != null) pp.release();
                    processingResult = pp != null;
                }
            } finally {
                CocoonComponentManager.endProcessing(newEnv, processKey);
View Full Code Here

Examples of org.apache.coyote.Processor

        // The second argument is the output file
        File outputFile = new File(args[1]);

        Adapter testAdapter = new RandomAdapter();
        Processor http11Processor = new Http11Processor();

        FileTester tester = new FileTester(testAdapter, http11Processor,
                                           inputFile, outputFile);
        tester.test();
View Full Code Here

Examples of org.apache.cxf.tools.common.Processor

                }
            }
            context.put(ToolConstants.SCHEMA_MAP, schemas);
            context.put(ToolConstants.PORTTYPE_MAP, interfaces);
            context.put(ClassCollector.class, new ClassCollector());
            Processor processor = frontend.getProcessor();
            if (processor instanceof ClassNameProcessor) {
                processor.setEnvironment(context);
                for (ServiceInfo service : serviceList) {

                    context.put(ServiceInfo.class, service);

                    ((ClassNameProcessor)processor).processClassNames();

                    context.put(ServiceInfo.class, null);
                }
            }
            generateTypes();

            for (ServiceInfo service : serviceList) {

                context.put(ServiceInfo.class, service);

                validate(service);

                // Build the JavaModel from the ServiceModel
                processor.setEnvironment(context);
                processor.process();

                if (!isSuppressCodeGen()) {
                    // Generate artifacts
                    for (FrontEndGenerator generator : frontend.getGenerators()) {
                        generator.generate(context);
View Full Code Here

Examples of org.apache.cxf.tools.common.Processor

        context.put(ToolConstants.XML_SCHEMA_COLLECTION, schemaCollection);
       
        context.put(ToolConstants.PORTTYPE_MAP, interfaces);
       
        context.put(ClassCollector.class, createClassCollector());
        Processor processor = frontend.getProcessor();
        if (processor instanceof ClassNameProcessor) {
            processor.setEnvironment(context);
            for (ServiceInfo service : serviceList) {

                context.put(ServiceInfo.class, service);

                ((ClassNameProcessor)processor).processClassNames();

                context.put(ServiceInfo.class, null);
            }
        }
       
        if (context.optionSet(ToolConstants.CFG_NO_TYPES)) {
            context.remove(ToolConstants.CFG_TYPES);
            context.remove(ToolConstants.CFG_ALL);
            context.remove(ToolConstants.CFG_COMPILE);
        }
       
        generateTypes();
        if (context.getErrorListener().getErrorCount() > 0) {
            return;
        }

        for (ServiceInfo service : serviceList) {
            context.put(ServiceInfo.class, service);

            if (context.basicValidateWSDL()) {
                validate(service);
            }

            if (context.getErrorListener().getErrorCount() == 0) {
                // Build the JavaModel from the ServiceModel
                processor.setEnvironment(context);
                processor.process();
            }
        }
        if (context.getErrorListener().getErrorCount() > 0) {
            return;
        }
View Full Code Here

Examples of org.apache.garbage.Processor

                t.tree = parser.parse(is);
                synchronized (cache) {
                    cache.put(source.getURI(), t);
                }
            }
            new Processor(this.xmlConsumer, this.xmlConsumer).process(t.tree, jxpathContext);
        } catch (TreeException exc) {
            throw new SAXParseException(exc.getMessage(), exc, exc);
        }
    }
View Full Code Here

Examples of org.apache.shale.remoting.Processor

                    log().trace("View identifier '" + context.getViewRoot().getViewId()
                                + "' matched pattern '" + mapping.getPattern()
                                + "' with resource id '" + resourceId + "'");
                }
                try {
                    Processor processor = mapping.getProcessor();
                    processor.process(context, resourceId);
                } catch (IOException e) {
                    throw new FacesException(e);
                }
                break;
            }
View Full Code Here

Examples of org.apache.slide.projector.Processor

        return resultDescriptor;
    }

    static ParameterDescriptor getParameterDescriptor(Map parameter, Context context) throws ProcessException {
        URI actionUri = (URIValue)parameter.get(ACTION);
        Processor action = ProcessorManager.getInstance().getProcessor(actionUri);
        String parameterName = parameter.get(PARAMETER).toString();
        ParameterDescriptor parameterDescriptor = ProcessorHelper.getParameterDescriptor(action, parameterName);
        if ( parameterDescriptor == null ) throw new ProcessException(new ErrorMessage("control/actionParameterNotFound", new Object[] { parameterName, actionUri }));
        return parameterDescriptor;
    }
View Full Code Here

Examples of org.apache.sling.rewriter.Processor

            if ( isPipeline ) {
                final PipelineImpl pipeline = new PipelineImpl(this.factoryCache);
                pipeline.init(context, configuration);
                return pipeline;
            }
            final Processor processor = new ProcessorWrapper(configuration, this.factoryCache);
            processor.init(context, configuration);
            return processor;
        } catch (final IOException ioe) {
            throw new SlingException("Unable to setup processor: " + ioe.getMessage(), ioe);
        }
    }
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.