ZetaGrid v1.9

zeta
Class WorkloadScheduler

java.lang.Object
  |
  +--zeta.WorkloadScheduler

public class WorkloadScheduler
extends java.lang.Object

Controls the computation in specified timeframes.


Field Summary
private  int[][] activeAt
           
private  boolean alwaysActive
           
private  int MAX_DAY
           
 
Constructor Summary
WorkloadScheduler(java.lang.String activeAt)
          Constructs the environment for the scheduler.
 
Method Summary
private static void addTimeframe(java.util.List timeframes, int startHour, int startMinute, int stopHour, int stopMinute)
           
private static boolean checkTimeframe(int startHour, int startMinute, int stopHour, int stopMinute)
           
 long getTimeMillisToNextTimeframe()
          Returns in milliseconds how long nothing will happen for the scheduler.
 boolean isActive()
          Checks if the computation can be active right now.
 boolean isAlwaysActive()
          Checks if the computation can be always active.
private static int[] timeframe(java.lang.String activeAt, int pos, java.lang.String dayOfWeek)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alwaysActive

private boolean alwaysActive

MAX_DAY

private final int MAX_DAY

activeAt

private int[][] activeAt
Constructor Detail

WorkloadScheduler

public WorkloadScheduler(java.lang.String activeAt)
Constructs the environment for the scheduler. The timeframes can be defined by the following format: {:-:}* where : the name of the day, i.e. (Mo, Tu, We, Th, Fr, Sa, Su) : controls what hour the computation will start, and is specified in the 24 hour clock, values must be between 0 and 23 (0 is midnight) : controls what minute of the hour the computation will start, value must be between 0 and 59 : controls what hour the computation will start, and is specified in the 24 hour clock, values must be between 0 and 23 (0 is midnight) : controls what minute of the hour the computation will stop, value must be between 0 and 59 Example: Mo08:00-12:00Mo13:00-20:00Tu00:00-00:00We00:00-00:00Th00:00-00:00Fr00:00-00:00

Parameters:
activeAt - the timeframes when the client can activate the computation
Method Detail

isAlwaysActive

public boolean isAlwaysActive()
Checks if the computation can be always active.

Returns:
true if the computation can be always active.

isActive

public boolean isActive()
Checks if the computation can be active right now.

Returns:
true if the computation can be active right now.

getTimeMillisToNextTimeframe

public long getTimeMillisToNextTimeframe()
Returns in milliseconds how long nothing will happen for the scheduler.

Returns:
in milliseconds how long nothing will happen for the scheduler.

checkTimeframe

private static boolean checkTimeframe(int startHour,
                                      int startMinute,
                                      int stopHour,
                                      int stopMinute)

addTimeframe

private static void addTimeframe(java.util.List timeframes,
                                 int startHour,
                                 int startMinute,
                                 int stopHour,
                                 int stopMinute)

timeframe

private static int[] timeframe(java.lang.String activeAt,
                               int pos,
                               java.lang.String dayOfWeek)

ZetaGrid v1.9

For further technical papers, see ZetaGrid Technical Documentation.
 
Copyright © 2001,2002 Sebastian Wedeniwski. All Rights Reserved.