/**
 * SleepTask is a simple Jini Entry implementation that specifies a
 * number of milliseconds for a SleepWorker to sleep.
 * <br/>
 * This source code is copyright 2008 by Patrick May.
 * All rights reserved.
 *
 * @author Patrick May (patrick@softwarematters.org)
 * @author &copy; 2008 Patrick May.  All rights reserved.
 * @version 1
 */

package org.softwarematters.example.MasterWorker;

import net.jini.core.entry.Entry;

import java.util.Random;

public class SleepTask implements Entry
{
  private static final int MAX_SLEEP_TIME = 5000;  // five seconds

  private static Random generator_ = new Random();

  public Long masterID;
  public Long taskID;
  public Long sleepTime;

  /**
   * The full constructor for the SleepTask class.
   */
  public SleepTask(long masterID,long taskID)
    {
    this.masterID = new Long(masterID);
    this.taskID = new Long(taskID);
    sleepTime = new Long(generator_.nextInt(MAX_SLEEP_TIME));
    }


  /**
   * The default constructor for the SleepTask class.
   */
  public SleepTask()
    {
    }
}  // end SleepTask

