Example usage for org.springframework.data.mongodb.core.messaging TaskFactory TaskFactory

List of usage examples for org.springframework.data.mongodb.core.messaging TaskFactory TaskFactory

Introduction

In this page you can find the example usage for org.springframework.data.mongodb.core.messaging TaskFactory TaskFactory.

Prototype

TaskFactory(MongoTemplate template) 

Source Link

Usage

From source file:org.springframework.data.mongodb.core.messaging.DefaultMessageListenerContainer.java

/**
 * Create a new {@link DefaultMessageListenerContainer} running {@link Task tasks} via the given
 * {@literal taskExecutor} delegating {@link Exception errors} to the given {@link ErrorHandler}.
 *
 * @param template must not be {@literal null}. Used by the {@link TaskFactory}.
 * @param taskExecutor must not be {@literal null}.
 * @param errorHandler the default {@link ErrorHandler} to be used by tasks inside the container. Can be
 *          {@literal null}.//from  ww  w  .j  av a  2s.c  om
 */
public DefaultMessageListenerContainer(MongoTemplate template, Executor taskExecutor,
        @Nullable ErrorHandler errorHandler) {

    Assert.notNull(template, "Template must not be null!");
    Assert.notNull(taskExecutor, "TaskExecutor must not be null!");

    this.taskExecutor = taskExecutor;
    this.taskFactory = new TaskFactory(template);
    this.errorHandler = Optional.ofNullable(errorHandler);
}