Package org.springframework.util

Examples of org.springframework.util.ErrorHandler


        }

        if (errorHandler != null) {
            container.setErrorHandler(errorHandler);
        } else {
            ErrorHandler handler = new DefaultSpringErrorHandler(EndpointMessageListener.class, getErrorHandlerLoggingLevel(), isErrorHandlerLogStackTrace());
            container.setErrorHandler(handler);
        }

        container.setAcceptMessagesWhileStopping(acceptMessagesWhileStopping);
        container.setExposeListenerSession(exposeListenerSession);
View Full Code Here


        }

        if (errorHandler != null) {
            container.setErrorHandler(errorHandler);
        } else {
            ErrorHandler handler = new DefaultSpringErrorHandler(EndpointMessageListener.class, getErrorHandlerLoggingLevel(), isErrorHandlerLogStackTrace());
            container.setErrorHandler(handler);
        }

        container.setAcceptMessagesWhileStopping(acceptMessagesWhileStopping);
        container.setExposeListenerSession(exposeListenerSession);
View Full Code Here

            this.listenerContainer.shutdown();
            this.listenerContainer.destroy();
        }

        public final ErrorHandler getErrorHandler() {
            return new ErrorHandler() {
                @Override
                public void handleError(Throwable t) {
                    if(t instanceof AmqpConnectException) {
                        LOG.error("AMQP Connection error, marking this connection as failed");
                        onClose(null);
View Full Code Here

    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(template.getConnectionFactory());
    container.setQueues(queue);
    final CountDownLatch messageReceived = new CountDownLatch(1);
    final CountDownLatch spiedQLogger = new CountDownLatch(1);
    final CountDownLatch errorHandled = new CountDownLatch(1);
    container.setErrorHandler(new ErrorHandler() {

      @Override
      public void handleError(Throwable t) {
        errorHandled.countDown();
        throw new AmqpRejectAndDontRequeueException("foo", t);
View Full Code Here

      return new AtomicReference<Throwable>();
    }

    @Bean
    public ErrorHandler errorHandler() {
      ErrorHandler handler = Mockito.spy(new ConditionalRejectingErrorHandler());
      Mockito.doAnswer(new Answer<Object>() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
          try {
            return invocation.callRealMethod();
View Full Code Here

TOP

Related Classes of org.springframework.util.ErrorHandler

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.