Package com.google.code.yanf4j.util

Source Code of com.google.code.yanf4j.util.DispatcherFactory

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;
    }
  }
}
TOP

Related Classes of com.google.code.yanf4j.util.DispatcherFactory

TOP
Copyright © 2018 www.massapi.com. 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.