Package org.springframework.util

Examples of org.springframework.util.ErrorHandler


      Runnable task, ErrorHandler errorHandler, boolean isRepeatingTask) {

    if (task instanceof DelegatingErrorHandlingRunnable) {
      return (DelegatingErrorHandlingRunnable) task;
    }
    ErrorHandler eh = errorHandler != null ? errorHandler : getDefaultErrorHandler(isRepeatingTask);
    return new DelegatingErrorHandlingRunnable(task, eh);
  }
View Full Code Here


  // TaskScheduler implementation

  public ScheduledFuture schedule(Runnable task, Trigger trigger) {
    ScheduledExecutorService executor = getScheduledExecutor();
    try {
      ErrorHandler errorHandler = this.errorHandler != null ?
          this.errorHandler : TaskUtils.getDefaultErrorHandler(true);
      return new ReschedulingRunnable(task, trigger, executor, errorHandler).schedule();
    }
    catch (RejectedExecutionException ex) {
      throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
View Full Code Here

        Advice[] adviceChain = new Advice[0];
        config.setAdviceChain(adviceChain);
        config.setConcurrentConsumers(5);
        ConnectionFactory mockConnectionFactory = mock(ConnectionFactory.class);
        testSubject.setConnectionFactory(mockConnectionFactory);
        ErrorHandler mockErrorHandler = mock(ErrorHandler.class);
        config.setErrorHandler(mockErrorHandler);
        MessagePropertiesConverter mockMessagePropertiesConverter = mock(MessagePropertiesConverter.class);
        config.setMessagePropertiesConverter(mockMessagePropertiesConverter);
        config.setPrefetchCount(6);
        config.setReceiveTimeout(6000L);
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

                System.out.println("Received from RabbitMQ: " + bigOp);
            }
        });

        // set a simple error handler
        listenerContainer.setErrorHandler(new ErrorHandler() {
            public void handleError(Throwable t) {
                t.printStackTrace();
            }
        });
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

            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

        }

        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

                receievedMessageHolder.add((BigOperation) messageConverter.fromMessage(message));
                fooLatch.countDown();
                barLatch.countDown();
            }
        });
        container.setErrorHandler(new ErrorHandler() {
            public void handleError(Throwable t) {
                t.printStackTrace();
            }
        });
View Full Code Here

        Advice[] adviceChain = new Advice[0];
        config.setAdviceChain(adviceChain);
        config.setConcurrentConsumers(5);
        ConnectionFactory mockConnectionFactory = mock(ConnectionFactory.class);
        testSubject.setConnectionFactory(mockConnectionFactory);
        ErrorHandler mockErrorHandler = mock(ErrorHandler.class);
        config.setErrorHandler(mockErrorHandler);
        MessagePropertiesConverter mockMessagePropertiesConverter = mock(MessagePropertiesConverter.class);
        config.setMessagePropertiesConverter(mockMessagePropertiesConverter);
        config.setPrefetchCount(6);
        config.setReceiveTimeout(6000L);
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.