Package org.apache.camel

Examples of org.apache.camel.Endpoint


        assertEquals(true, sftpEndpoint.getConfiguration().isDirectory());
        assertEquals(false, sftpEndpoint.getConfiguration().isBinary());
    }

    public void testSftpConfigurationDirectory() throws Exception {
        Endpoint endpoint = context.getEndpoint("sftp://camel-user@localhost:123/tmp?password=secret");
        assertTrue("Endpoint not an SftpEndpoint: " + endpoint, endpoint instanceof SftpEndpoint);
        SftpEndpoint sftpEndpoint = (SftpEndpoint) endpoint;

        assertEquals("localhost", sftpEndpoint.getConfiguration().getHost());
        assertEquals(123, sftpEndpoint.getConfiguration().getPort());
View Full Code Here


        assertEquals("/tmp", sftpEndpoint.getConfiguration().getFile());
        assertEquals(true, sftpEndpoint.getConfiguration().isDirectory());
    }

    public void testSftpConfigurationFile() throws Exception {
        Endpoint endpoint = context.getEndpoint("sftp://camel-user@localhost:123/tmp/file?password=secret&directory=false");
        assertTrue("Endpoint not an SftpEndpoint: " + endpoint, endpoint instanceof SftpEndpoint);
        SftpEndpoint sftpEndpoint = (SftpEndpoint) endpoint;

        assertEquals("localhost", sftpEndpoint.getConfiguration().getHost());
        assertEquals(123, sftpEndpoint.getConfiguration().getPort());
View Full Code Here

    }

    public Object getObject() throws Exception {
        CamelContext context = getCamelContext();
        if (defaultEndpoint != null) {
            Endpoint endpoint = context.getEndpoint(defaultEndpoint);
            if (endpoint == null) {
                throw new IllegalArgumentException("No endpoint found for URI: " + defaultEndpoint);
            } else {
                return new CamelTemplate(context, endpoint);
            }
View Full Code Here

        MessageDriven annotation = method.getAnnotation(MessageDriven.class);
        if (annotation != null) {
            LOG.info("Creating a consumer for: " + annotation);

            // lets bind this method to a listener
            Endpoint endpoint = getEndpointInjection(annotation.uri(), annotation.name());
            if (endpoint != null) {
                try {
                    Processor processor = createConsumerProcessor(bean, method, endpoint);
                    LOG.info("Created processor: " + processor);
                    Consumer consumer = endpoint.createConsumer(processor);
                    consumer.start();
                    addConsumer(consumer);
                } catch (Exception e) {
                    LOG.warn(e);
                    throw new RuntimeCamelException(e);
View Full Code Here

    /**
     * Creates the value for the injection point for the given annotation
     */
    protected Object getEndpointInjectionValue(EndpointInject annotation, Class<?> type) {
        Endpoint endpoint = getEndpointInjection(annotation.uri(), annotation.name());
        if (endpoint != null) {
            if (type.isInstance(endpoint)) {
                return endpoint;
            } else if (type.isAssignableFrom(Producer.class)) {
                try {
                    return endpoint.createProducer();
                } catch (Exception e) {
                    throw new RuntimeCamelException(e);
                }
            } else if (type.isAssignableFrom(CamelTemplate.class)) {
                return new CamelTemplate(getCamelContext(), endpoint);
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        ServiceHelper.startServices(template, camelContext);

        Endpoint value = camelContext.getEndpoint(getEndpointUri());
        assertNotNull("Could not find endpoint!", value);
        assertTrue("Should be a JPA endpoint but was: " + value, value instanceof JpaEndpoint);
        endpoint = (JpaEndpoint)value;

        transactionStrategy = endpoint.createTransactionStrategy();
View Full Code Here

        mimeMessage.setText(body);
    }

    @Override
    protected MailEndpoint resolveMandatoryEndpoint(String uri) {
        Endpoint endpoint = super.resolveMandatoryEndpoint(uri);
        return assertIsInstanceOf(MailEndpoint.class, endpoint);
    }
View Full Code Here

    }


    @Override
    protected MailEndpoint resolveMandatoryEndpoint(String uri) {
        Endpoint endpoint = super.resolveMandatoryEndpoint(uri);
        return assertIsInstanceOf(MailEndpoint.class, endpoint);
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        startServices(template, camelContext);

        Endpoint value = camelContext.getEndpoint(getEndpointUri());
        assertNotNull("Could not find endpoint!", value);
        assertTrue("Should be a JPA endpoint but was: " + value, value instanceof JpaEndpoint);
        endpoint = (JpaEndpoint) value;

        transactionStrategy = endpoint.createTransactionStrategy();
View Full Code Here

    }

    @Override
    protected JmsEndpoint resolveMandatoryEndpoint(String uri) {
        Endpoint endpoint = super.resolveMandatoryEndpoint(uri);
        return assertIsInstanceOf(JmsEndpoint.class, endpoint);
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.Endpoint

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.