BEA Systems, Inc.

WebLogic Server 5.1.0 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, and then call its schedule() method with the current time, or 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 © 2000 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.
 
Method Summary
 long lastTime()
          Returns the last time this Schedulable's schedule() was called.
 long schedule(long currentMillis)
          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
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 currentMillis)
Sets the time of the first scheduled occurrence of a regularly repeating schedule. Implements the schedule() method from the Schedulable interface. 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. 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 - Time of first scheduled occurrence
Returns:
Time of next occurrence

Documentation is available at
http://www.weblogic.com/docs51