Package org.apache.camel.processor

Examples of org.apache.camel.processor.Logger


        assertEquals("pubSubDomain", false, template.isPubSubDomain());
    }

    public void testListenerContainerUsesSpringConnectionFactory() throws Exception {
        JmsEndpoint endpoint = resolveMandatoryEndpoint("activemq:topic:test.foo");
        JmsConsumer consumer = endpoint.createConsumer(new Logger());

        AbstractMessageListenerContainer listenerContainer = consumer.getListenerContainer();
        assertIsInstanceOf(ActiveMQConnectionFactory.class, listenerContainer.getConnectionFactory());
        assertEquals("pubSubDomain", true, listenerContainer.isPubSubDomain());
View Full Code Here


        policy.setRedeliverDelay(0);
        return policy;
    }

    protected Logger createLogger() {
        return new Logger(LogFactory.getLog(DefaultErrorHandler.class), LoggingLevel.ERROR);
    }
View Full Code Here

        assertEquals("pubSubDomain", false, template.isPubSubDomain());
    }

    public void testListenerContainerUsesSpringConnectionFactory() throws Exception {
        JmsEndpoint endpoint = resolveMandatoryEndpoint("activemq:topic:test.foo");
        JmsConsumer consumer = endpoint.createConsumer(new Logger());

        AbstractMessageListenerContainer listenerContainer = consumer.getListenerContainer();
        assertIsInstanceOf(ActiveMQConnectionFactory.class, listenerContainer.getConnectionFactory());
        assertEquals("pubSubDomain", true, listenerContainer.isPubSubDomain());
View Full Code Here

    public MinaConsumer(final MinaEndpoint endpoint, Processor processor) {
        super(endpoint, processor);
        this.address = endpoint.getAddress();
        this.acceptor = endpoint.getAcceptor();
        this.sync = endpoint.getConfiguration().isSync();
        this.noReplyLogger = new Logger(LOG, endpoint.getConfiguration().getNoReplyLogLevel());
    }
View Full Code Here

    public MinaProducer(MinaEndpoint endpoint) {
        super(endpoint);
        this.lazySessionCreation = endpoint.getConfiguration().isLazySessionCreation();
        this.timeout = endpoint.getConfiguration().getTimeout();
        this.sync = endpoint.getConfiguration().isSync();
        this.noReplyLogger = new Logger(LOG, endpoint.getConfiguration().getNoReplyLogLevel());
    }
View Full Code Here

    @Test
    public void testInvalidMaxConcurrentConsumers() throws Exception {
        JmsEndpoint endpoint = (JmsEndpoint) resolveMandatoryEndpoint("jms:queue:Foo?concurrentConsumers=5&maxConcurrentConsumers=2");
        try {
            endpoint.createConsumer(new Logger());
            fail("Should have thrown exception");
        } catch (IllegalArgumentException e) {
            assertEquals("Property maxConcurrentConsumers: 2 must be higher than concurrentConsumers: 5", e.getMessage());
        }
    }
View Full Code Here

    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        LoggingLevel level = getLoggingLevel(parameters);
        Integer groupSize = getAndRemoveParameter(parameters, "groupSize", Integer.class);
        Long groupInterval = getAndRemoveParameter(parameters, "groupInterval", Long.class);

        Logger logger;
        if (groupSize != null) {
            logger = new ThroughputLogger(remaining, level, groupSize);
        } else if (groupInterval != null) {
            Boolean groupActiveOnly = getAndRemoveParameter(parameters, "groupActiveOnly", Boolean.class, Boolean.TRUE);
            Long groupDelay = getAndRemoveParameter(parameters, "groupDelay", Long.class);
            logger = new ThroughputLogger(this.getCamelContext(), remaining, level, groupInterval, groupDelay, groupActiveOnly);
        } else {
            LogFormatter formatter = new LogFormatter();
            IntrospectionSupport.setProperties(formatter, parameters);

            logger = new Logger(remaining);
            logger.setLevel(level);
            logger.setFormatter(formatter);
        }

        LogEndpoint endpoint = new LogEndpoint(uri, this);
        setProperties(endpoint, parameters);
        return new LogEndpoint(uri, this, logger);
View Full Code Here

        assertIsInstanceOf(ActiveMQConnectionFactory.class, template.getConnectionFactory());
    }

    public void testListenerContainerUsesSpringConnectionFactory() throws Exception {
        JmsEndpoint endpoint = resolveMandatoryEndpoint("activemq:topic:test.foo");
        JmsConsumer consumer = endpoint.createConsumer(new Logger());

        AbstractMessageListenerContainer listenerContainer = consumer.getListenerContainer();
        assertEquals("pubSubDomain", true, listenerContainer.isPubSubDomain());
        assertIsInstanceOf(PooledConnectionFactory.class, listenerContainer.getConnectionFactory());
    }
View Full Code Here

        this.node = node;
        this.formatter = formatter;

        // set logger to use
        if (tracer.getLogName() != null) {
            logger = new Logger(LogFactory.getLog(tracer.getLogName()), this);
        } else {
            // use default logger
            logger = new Logger(LogFactory.getLog(TraceInterceptor.class), this);
        }

        // set logging level if provided
        if (tracer.getLogLevel() != null) {
            logger.setLevel(tracer.getLogLevel());
View Full Code Here

*/
public class LoggingExceptionHandler implements ExceptionHandler {
    private final Logger logger;

    public LoggingExceptionHandler(Class ownerType) {
        this(new Logger(LogFactory.getLog(ownerType), LoggingLevel.ERROR));
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.processor.Logger

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.