Package com.whatevernot.engine

Source Code of com.whatevernot.engine.EngineFactory

package com.whatevernot.engine;

import java.util.concurrent.BlockingQueue;

import com.whatevernot.engine.standard.Engine;
import com.whatevernot.util.ITimer;
import com.whatevernot.util.NullTimer;

/**
* Standard Singleton access.
* @author parki
*/
public class EngineFactory
{
  /**
   * Return an engine implementation to the caller.
   * @return An engine to handle requests.
   */
  public static IEngine makeEngine()
  {
    return makeEngine(new NullTimer());
  }
 
  /**
   * Return an engine with the supplied blocking queue.
   * @param blockingQueue The queue.
   * @return The engine.
   */
  public static IEngine makeEngine(BlockingQueue<Runnable> blockingQueue)
  {
    return new Engine(blockingQueue);
  }
 
  /**
   * Return an engine implementation to the caller. The
   * caller also supplies a timer object used to record the
   * execution of the engine.
   * @return The engine.
   */
  public static IEngine makeEngine(ITimer timer)
  {
    return new Engine(timer);
  }
}
TOP

Related Classes of com.whatevernot.engine.EngineFactory

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.