Package org.apache.camel.impl

Examples of org.apache.camel.impl.ProcessorEndpoint


        final ContentHistoryService contentHistoryService = this;
        try {
            camelContext.addRoutes(new RouteBuilder() {
                @Override
                public void configure() throws Exception {
                    from(from).filter("groovy", "!request.body.contains(\" viewed \")").to(new ProcessorEndpoint(
                            "contentHistoryService", camelContext, contentHistoryService));
                }
            });
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
View Full Code Here


        if (endpoint != null) {
            endpoint.setCamelContext(this);
            return endpoint;
        }

        return new ProcessorEndpoint(uri, this, new BeanProcessor(bean, this));
    }
View Full Code Here

        return registry;
    }
   
    @Test
    public void configureWithDefaults() throws Exception {
        ProcessorEndpoint endpoint = context.getEndpoint("bean-validator://x", ProcessorEndpoint.class);
        BeanValidator processor = (BeanValidator) endpoint.getProcessor();

        assertNull(processor.getGroup());
        assertTrue(processor.getValidator() instanceof ValidatorImpl);
        assertTrue(processor.getMessageInterpolator() instanceof ResourceBundleMessageInterpolator);
        assertTrue(processor.getTraversableResolver() instanceof DefaultTraversableResolver);
View Full Code Here

        assertTrue(processor.getConstraintValidatorFactory() instanceof ConstraintValidatorFactoryImpl);
    }
   
    @Test
    public void configureBeanValidator() throws Exception {
        ProcessorEndpoint endpoint = context.getEndpoint("bean-validator://x"
                + "?group=org.apache.camel.component.bean.validator.OptionalChecks"
                + "&messageInterpolator=#myMessageInterpolator"
                + "&traversableResolver=#myTraversableResolver"
                + "&constraintValidatorFactory=myConstraintValidatorFactory", ProcessorEndpoint.class);
        BeanValidator processor = (BeanValidator) endpoint.getProcessor();

        assertEquals("org.apache.camel.component.bean.validator.OptionalChecks", processor.getGroup().getName());
        assertTrue(processor.getValidator() instanceof ValidatorImpl);
        assertSame(processor.getMessageInterpolator(), this.messageInterpolator);
        assertSame(processor.getTraversableResolver(), this.traversableResolver);
View Full Code Here

        if (endpoint != null) {
            endpoint.setCamelContext(this);
            return endpoint;
        }

        return new ProcessorEndpoint(uri, this, new BeanProcessor(bean, this));
    }
View Full Code Here

        String output = getAndRemoveParameter(parameters, "output", String.class);
        configureOutput(xslt, output);

        xslt.setTransformerInputStream(resource.getInputStream());
        configureXslt(xslt, uri, remaining, parameters);
        return new ProcessorEndpoint(uri, this, xslt);
    }
View Full Code Here

       
        if (group != null) {
            beanValidator.setGroup(getCamelContext().getClassResolver().resolveMandatoryClass(group));
        }

        return new ProcessorEndpoint(uri, this, beanValidator);
    }
View Full Code Here

        return registry;
    }
   
    @Test
    public void configureWithDefaults() throws Exception {
        ProcessorEndpoint endpoint = (ProcessorEndpoint) context.getEndpoint("bean-validator://x");
        BeanValidator processor = (BeanValidator) endpoint.getProcessor();

        assertNull(processor.getGroup());
        assertTrue(processor.getValidator() instanceof ValidatorImpl);
        assertTrue(processor.getMessageInterpolator() instanceof ResourceBundleMessageInterpolator);
        assertTrue(processor.getTraversableResolver() instanceof DefaultTraversableResolver);
View Full Code Here

        assertTrue(processor.getConstraintValidatorFactory() instanceof ConstraintValidatorFactoryImpl);
    }
   
    @Test
    public void configureBeanValidator() throws Exception {
        ProcessorEndpoint endpoint = (ProcessorEndpoint) context.getEndpoint("bean-validator://x"
                + "?group=org.apache.camel.component.bean.validator.OptionalChecks"
                + "&messageInterpolator=#myMessageInterpolator"
                + "&traversableResolver=#myTraversableResolver"
                + "&constraintValidatorFactory=myConstraintValidatorFactory");
        BeanValidator processor = (BeanValidator) endpoint.getProcessor();

        assertEquals("org.apache.camel.component.bean.validator.OptionalChecks", processor.getGroup().getName());
        assertTrue(processor.getValidator() instanceof ValidatorImpl);
        assertSame(processor.getMessageInterpolator(), this.messageInterpolator);
        assertSame(processor.getTraversableResolver(), this.traversableResolver);
View Full Code Here

        loadResource(xslt, resource);

        // default to use the cache option from the component if the endpoint did not have the contentCache parameter
        boolean cache = getAndRemoveParameter(parameters, "contentCache", Boolean.class, contentCache);
        if (!cache) {
            return new ProcessorEndpoint(uri, this, xslt) {
                @Override
                protected void onExchange(Exchange exchange) throws Exception {
                    // force to load the resource on each exchange as we are not cached
                    loadResource(xslt, resource);
                    super.onExchange(exchange);
                }
            };
        } else {
            // we have already loaded xslt so we are cached
            return new ProcessorEndpoint(uri, this, xslt);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.impl.ProcessorEndpoint

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.