Oracle Containers for J2EE Job Scheduler Java API Reference
10g Release 3 (10.1.3)

B16026-01

oracle.ias.scheduler
Class RecurSchedule

java.lang.Object
  extended byoracle.ias.scheduler.Schedule
      extended byoracle.ias.scheduler.RepeatingSchedule
          extended byoracle.ias.scheduler.RecurSchedule
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class RecurSchedule
extends RepeatingSchedule
implements java.io.Externalizable

See Also:
Serialized Form

Field Summary
 
Fields inherited from class oracle.ias.scheduler.RepeatingSchedule
m_endDate, m_fixedDelay
 
Fields inherited from class oracle.ias.scheduler.Schedule
m_expirationDate
 
Constructor Summary
RecurSchedule()
          Internal use only.
RecurSchedule(java.lang.String expr)
          Construct a new schedule with the RFC-2445 recur expression specified.
 
Method Summary
 boolean equals(java.lang.Object v)
          Indicates whether some object is "equal to" this one.
 java.util.Calendar expected(java.util.Calendar date)
          Gets the expected expiration date for this schedule for the date specified.
 java.util.Calendar getEndDate()
          Gets the end date of this schedule.
 java.util.Calendar getExpiration()
          Gets the initial expiration for the schedule.
 long getExpirationMillis()
          Returns the expiration for the schedule.
 boolean isRepeating()
          Used to identify a repeating schedule.
static void main(java.lang.String[] args)
           
 java.util.Calendar next()
          Gets the next date/time at which a timeout should be generated for this schedule accounting for the end date if applicable.
 java.util.Calendar next(java.util.Calendar datetime)
          Gets the next date/time at which a timeout should be generated from that specified for this schedule accounting for the end date if applicable.
 void readExternal(java.io.ObjectInput in)
          Restores the contents of this object from the stream specified.
 void setCount(int count)
          Set the number of times the schedule should repeat.
 void setEndDate(java.util.Calendar end)
          Sets the end date for this schedule.
 void setExpiration(java.util.Calendar expiration)
          Set the initial expiration date for the schedule.
 void setExpiration(long expiration)
          Set the initial expiration date for the schedule.
 void writeExternal(java.io.ObjectOutput out)
          Saves the contents of this object to the stream specified.
 
Methods inherited from class oracle.ias.scheduler.RepeatingSchedule
isFixedDelay, setFixedDelay
 
Methods inherited from class oracle.ias.scheduler.Schedule
getVersion, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RecurSchedule

public RecurSchedule()
Internal use only.


RecurSchedule

public RecurSchedule(java.lang.String expr)
              throws InvalidArgumentException
Construct a new schedule with the RFC-2445 recur expression specified.

Throws:
InvalidArgumentException - if the expression specified is malformed or invalid
Method Detail

isRepeating

public boolean isRepeating()
Used to identify a repeating schedule.

Overrides:
isRepeating in class Schedule
Returns:
always returns true for this implementation.
See Also:
IntervalSchedule, oracle.ias.scheduler.CronIntervalSchedule

setExpiration

public void setExpiration(long expiration)
Set the initial expiration date for the schedule. If no expiration date is specified the current time will be used. If the specified value does not occur within the set defined by the recurrence expression for this schedule it will be adjusted as necessary.

Overrides:
setExpiration in class Schedule
Parameters:
expiration - in millis from current time at which initial expiration will occur.

setExpiration

public void setExpiration(java.util.Calendar expiration)
Set the initial expiration date for the schedule. If no expiration date is specified the current time will be used. If the specified value does not occur within the set defined by the recurrence expression for this schedule it will be adjusted as necessary.

Overrides:
setExpiration in class Schedule
Parameters:
expiration - date/time at which initial expiration will occur.

getExpiration

public java.util.Calendar getExpiration()
Gets the initial expiration for the schedule.

Overrides:
getExpiration in class Schedule
Returns:
date of of initial expiration.

getExpirationMillis

public long getExpirationMillis()
Returns the expiration for the schedule. The expiration is calculated using the current system time.

Returns:
number of milliseconds to the initial expiration or zero if current time is past the initial expiration.

setEndDate

public void setEndDate(java.util.Calendar end)
Sets the end date for this schedule. The end date is consulted after every expiration and becomes effective when the date specified occurs before the next interval. Once active the associated schedule is no longer capable of generating timeouts.

Overrides:
setEndDate in class RepeatingSchedule
Parameters:
end - date on which schedule ends.

getEndDate

public java.util.Calendar getEndDate()
Gets the end date of this schedule.

Overrides:
getEndDate in class RepeatingSchedule
Returns:
date on which schedule ends or, if not repeating, the initial expiration date of the schedule.

next

public java.util.Calendar next()
Gets the next date/time at which a timeout should be generated for this schedule accounting for the end date if applicable.

Returns:
date/time at which the next timeout should occur, or null if the end date is active.

next

public java.util.Calendar next(java.util.Calendar datetime)
Gets the next date/time at which a timeout should be generated from that specified for this schedule accounting for the end date if applicable.

Overrides:
next in class Schedule
Returns:
date/time at which the next timeout should occur, or null if the end date is active.
See Also:
IntervalSchedule, RecurSchedule

expected

public java.util.Calendar expected(java.util.Calendar date)
Gets the expected expiration date for this schedule for the date specified.

Overrides:
expected in class Schedule
Parameters:
date - from which the expected expiration is calculated
Returns:
expected expiration or null if the schedule is fixed-delay.

setCount

public void setCount(int count)
Set the number of times the schedule should repeat. A schedule may either have one of a count or an end date, but not both. Setting the count has the same effect as setting the end date.

Parameters:
count - number of times the schedule will repeat.

equals

public boolean equals(java.lang.Object v)
Indicates whether some object is "equal to" this one.

Overrides:
equals in class Schedule

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Saves the contents of this object to the stream specified.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class Schedule
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restores the contents of this object from the stream specified.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class Schedule
Throws:
java.io.IOException
java.lang.ClassNotFoundException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

Oracle Containers for J2EE Job Scheduler Java API Reference
10g Release 3 (10.1.3)

B16026-01

Copyright © 2006, Oracle. All rights reserved.