BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.time.common
Class TimeRepeat

java.lang.Object
  |
  +--weblogic.time.common.TimeRepeat

public class TimeRepeat
extends java.lang.Object
implements Schedulable

A utility class for scheduling a repeating trigger. This class implements Schedulable, and may be used as an argument to the constructor for a Scheduler object, which in turn becomes an argument for a call to the factory method, TimeServicesDef.getScheduledTrigger(). To use this class, set the interval of repetition in its constructor, you may also want to call its setFirstScheduleTime() method with the time of day (in milliseconds) at which the first occurrence of the schedule should begin.

Author:
Copyright (c) 1996-97 by WebLogic, Inc. All Rights Reserved., Copyright (c) 1999 by BEA WebXpress. All Rights Reserved.
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
TimeServicesDef

Constructor Summary
TimeRepeat()
          Internal use only.
TimeRepeat(int intervalMillis)
          Constructs a TimeRepeat (a Schedulable object) that repeats regularly, for scheduling triggers.
TimeRepeat(long intervalMillis)
          Constructs a TimeRepeat that repeats regularly,
 
Method Summary
 long getFirstScheduleTime()
           
 long lastTime()
          Returns the last time this Schedulable's schedule() was called.
 long schedule(long currentTimeMillis)
          Implements the schedule() method from the Schedulable interface.
 void setFirstScheduleTime(long firstScheduleTimeInMillis)
          Sets the time of the first scheduled occurrence of a regularly repeating schedule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeRepeat

public TimeRepeat()
Internal use only.

TimeRepeat

public TimeRepeat(int intervalMillis)
Constructs a TimeRepeat (a Schedulable object) that repeats regularly, for scheduling triggers.

Parameters:
intervalMillis - Interval of repetition

TimeRepeat

public TimeRepeat(long intervalMillis)
Constructs a TimeRepeat that repeats regularly,

Parameters:
intervalMillis - Interval of repetition
Method Detail

lastTime

public long lastTime()
Returns the last time this Schedulable's schedule() was called.

Returns:
Time of day in milliseconds

schedule

public long schedule(long currentTimeMillis)
Implements the schedule() method from the Schedulable interface. This method is called by the trigger machinery not the user. The repeat algorithm is setup specifically not to drift, which means that the timer will have very tight periodicity.
Specified by:
schedule in interface Schedulable

Parameters:
currentMillis - currentTime
Returns:
Time of next occurrence

setFirstScheduleTime

public void setFirstScheduleTime(long firstScheduleTimeInMillis)
Sets the time of the first scheduled occurrence of a regularly repeating schedule. Call this method with the time of day in milliseconds to start the schedule, which will then repeat regularly according to the interval set in the constructor. Note if the firstScheduleTimeInMillis is less than currentTimeMillis then this causes the trigger to not rescheduled.

Parameters:
firstScheduleTimeInMillis - the time of the day in milliseconds when the first trigger will run

getFirstScheduleTime

public long getFirstScheduleTime()


Documentation is available at
http://e-docs.bea.com/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.