All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.code.yanf4j.util.DispatcherFactory Maven / Gradle / Ivy

There is a newer version: 2.4.8
Show newest version
package com.google.code.yanf4j.util;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.TimeUnit;
import com.google.code.yanf4j.core.impl.PoolDispatcher;

/**
 * Dispatcher Factory
 * 
 * @author dennis
 * 
 */
public class DispatcherFactory {
  public static com.google.code.yanf4j.core.Dispatcher newDispatcher(int size,
      RejectedExecutionHandler rejectedExecutionHandler, String prefix) {
    if (size > 0) {
      return new PoolDispatcher(size, 60, TimeUnit.SECONDS, rejectedExecutionHandler, prefix);
    } else {
      return null;
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy