WebObjects 5.4.2

com.webobjects.appserver
Class WOTimer

java.lang.Object
  extended by com.webobjects.appserver.WOTimer

Deprecated. use the Java class java.util.Timer

@Deprecated
public class WOTimer
extends Object

WOTimer creates timer objects, or more simply, timers. A timer waits until its fireDate is reached and then fires, sending a specified message to a specified object. If you specify that the timer should repeat, it automatically reschedules itself after it fires.

The static method scheduledTimer creates and schedules a timer. The constructors create timers which can later be scheduled by invoking the method schedule. Timers can be unscheduled by invoking invalidate on the timer to be unscheduled.

See Also:
WOTimer.fireDate(), WOTimer.invalidate(), WOTimer.schedule(), WOTimer.scheduledTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, boolean repeats), WOTimer.scheduledTimer(long ti, Object aTarget, String aSelectorName, Object anArgument, Class anArgumentClass, boolean repeats)

Constructor Summary
WOTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeats)
          Deprecated. Creates a timer which will fire after ti milliseconds, and at intervals ti thereafter (if repeats is true).
WOTimer(NSTimestamp fireDate, long interval, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeats)
          Deprecated. Creates a timer which will fire at fireDate, and at intervals ti thereafter (if repeats is true).
 
Method Summary
 boolean equals(Object aTimer)
          Deprecated. Return true if aTimer is an instance of WOTimer with the same selector, target, and userInfo as the receiver.
 void fire()
          Deprecated. Fires the timer, invoking selector on target and passing either the WOTimer -- if userInfoClass was null when the WOTimer was created -- or userInfo.
 NSTimestamp fireDate()
          Deprecated. Return the NSTimestamp at which the WOTimer will first fire.
 int hashCode()
          Deprecated.  
 void invalidate()
          Deprecated. Unschedules the timer and marks it as invalid.
 boolean isValid()
          Deprecated. Returns whether or not the timer is valid.
 void schedule()
          Deprecated. Schedule the WOTimer to be fired.
static WOTimer scheduledTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, boolean repeats)
          Deprecated. Creates a timer which will fire after ti milliseconds, and at intervals ti thereafter (if repeats is true).
static WOTimer scheduledTimer(long ti, Object aTarget, String aSelectorName, Object anArgument, Class anArgumentClass, boolean repeats)
          Deprecated. Creates a timer which will fire after ti milliseconds, and at intervals ti thereafter (if repeats is true).
 NSSelector selector()
          Deprecated. Returns the NSSelector which will be invoked when the WOTimer fires.
 Object target()
          Deprecated. Returns the object on which selector will be invoked when the WOTimer fires.
 double timeInterval()
          Deprecated. Return the interval in seconds at which the WOTimer will repeat firing.
 String toString()
          Deprecated.  
 Object userInfo()
          Deprecated. Returns the userInfo object that was passed when the timer was created.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WOTimer

public WOTimer(long ti,
               Object aTarget,
               String aSelectorName,
               Object userInfo,
               Class userInfoClass,
               boolean repeats)
Deprecated. 
Creates a timer which will fire after ti milliseconds, and at intervals ti thereafter (if repeats is true).

If userInfoClass is null, aSelectorName must take an object of class WOTimer as a parameter, and userInfo will be available to the selector invoking userInfo on the parameter timer. Otherwise, aSelectorName must take an object of class userInfoClass and userInfo must be an object of this class.

Parameters:
ti - the interval in milliseconds between successive firings of the timer
aTarget - the method on which aSelectorName will be invoked
aSelectorName - the method to be invoked when the timer fires
userInfo - user information that should be passed on when the timer fires
userInfoClass - the class of userInfo
repeats - whether or not the timer should fire repeatedly
See Also:
WOTimer.WOTimer(NSTimestamp fireDate, long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeats)

WOTimer

public WOTimer(NSTimestamp fireDate,
               long interval,
               Object aTarget,
               String aSelectorName,
               Object userInfo,
               Class userInfoClass,
               boolean repeats)
Deprecated. 
Creates a timer which will fire at fireDate, and at intervals ti thereafter (if repeats is true).

If userInfoClass is null, aSelectorName must take an object of class WOTimer as a parameter, and userInfo will be available to the selector invoking userInfo on the parameter timer. Otherwise, aSelectorName must take an object of class userInfoClass and userInfo must be an object of this class.

Parameters:
fireDate - the time at which the timer should first fire
interval - the interval in milliseconds between successive firings of the timer
aTarget - the method on which aSelectorName will be invoked
aSelectorName - the method to be invoked when the timer fires
userInfo - user information that should be passed on when the timer fires
userInfoClass - the class of userInfo
repeats - whether or not the timer should fire repeatedly
See Also:
WOTimer.WOTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeats)
Method Detail

scheduledTimer

public static WOTimer scheduledTimer(long ti,
                                     Object aTarget,
                                     String aSelectorName,
                                     Object userInfo,
                                     boolean repeats)
Deprecated. 
Creates a timer which will fire after ti milliseconds, and at intervals ti thereafter (if repeats is true).

aSelectorName must take an object of class WOTimer as a parameter, and userInfo will be available to the selector invoking userInfo on the parameter timer.

Parameters:
ti - the interval in milliseconds between successive firings of the timer
aTarget - the method on which aSelectorName will be invoked
aSelectorName - the method to be invoked when the timer fires
userInfo - user information that should be passed on when the timer fires
repeats - whether or not the timer should fire repeatedly
Returns:
true if the timer was scheduled successfully, false otherwise
See Also:
WOTimer.WOTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeats)

scheduledTimer

public static WOTimer scheduledTimer(long ti,
                                     Object aTarget,
                                     String aSelectorName,
                                     Object anArgument,
                                     Class anArgumentClass,
                                     boolean repeats)
Deprecated. 
Creates a timer which will fire after ti milliseconds, and at intervals ti thereafter (if repeats is true).

If anArgumentClass is null, aSelectorName must take an object of class WOTimer as a parameter, and userInfo will be available to the selector invoking userInfo on the parameter timer. Otherwise, aSelectorName must take an object of class anArgumentClass and anArgument must be an object of this class.

Parameters:
ti - the interval in milliseconds between successive firings of the timer
aTarget - the method on which aSelectorName will be invoked
aSelectorName - the method to be invoked when the timer fires
anArgument - parmeter that will be passed to aSelectorName when it is invoked
anArgumentClass - the class of anArgument
repeats - whether or not the timer should fire repeatedly
Returns:
true if the timer was scheduled successfully, false otherwise
See Also:
WOTimer.WOTimer(long ti, Object aTarget, String aSelectorName, Object userInfo, Class userInfoClass, boolean repeats)

fire

public void fire()
Deprecated. 
Fires the timer, invoking selector on target and passing either the WOTimer -- if userInfoClass was null when the WOTimer was created -- or userInfo.

See Also:
WOTimer.selector(), WOTimer.target(), WOTimer.userInfo()

fireDate

public NSTimestamp fireDate()
Deprecated. 
Return the NSTimestamp at which the WOTimer will first fire.

Returns:
the NSTimestamp at which the WOTimer will first fire

timeInterval

public double timeInterval()
Deprecated. 
Return the interval in seconds at which the WOTimer will repeat firing.

Returns:
the interval in seconds at which the WOTimer will repeat firing

invalidate

public void invalidate()
Deprecated. 
Unschedules the timer and marks it as invalid.

See Also:
WOTimer.schedule()

isValid

public boolean isValid()
Deprecated. 
Returns whether or not the timer is valid.

Returns:
true if the timer is valid

userInfo

public Object userInfo()
Deprecated. 
Returns the userInfo object that was passed when the timer was created.

Returns:
the userInfo object that was passed when the timer was created

target

public Object target()
Deprecated. 
Returns the object on which selector will be invoked when the WOTimer fires.

Returns:
the object on which selector will be invoked
See Also:
WOTimer.selector()

selector

public NSSelector selector()
Deprecated. 
Returns the NSSelector which will be invoked when the WOTimer fires.

Returns:
the NSSelector which will be invoked

schedule

public void schedule()
Deprecated. 
Schedule the WOTimer to be fired.

See Also:
WOTimer.invalidate()

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object

equals

public boolean equals(Object aTimer)
Deprecated. 
Return true if aTimer is an instance of WOTimer with the same selector, target, and userInfo as the receiver.

Overrides:
equals in class Object
Parameters:
aTimer - the timer to be compared
Returns:
true if the objects are equal
See Also:
WOTimer.selector(), WOTimer.target(), WOTimer.userInfo()

hashCode

public int hashCode()
Deprecated. 
Overrides:
hashCode in class Object

Last updated June 2008

Copyright © 2000-2008 Apple Inc.