public class TimerTask extends java.lang.Object implements AlarmListener, java.io.Closeable
Constructor and Description |
---|
TimerTask(EjbTimerContainer timerService,
TimeoutInvoker invoker,
EjbTimer task,
CronExpression cronExpression,
Trigger trigger,
java.io.Serializable data)
Constructs a new scheduled task.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the scheduled task.
|
void |
close() |
boolean |
equals(java.lang.Object object)
Checks for equality with another object.
|
CronExpression |
getCronExpression()
Gets the cron expression used to create the schedule.
|
java.io.Serializable |
getData()
Gets the data to be passed to the invocation target.
|
long |
getNextAlarmTime()
Get the next time, in milliseconds, when the alarm will be triggered for
the scheduled task.
|
ScheduledTaskStatus |
getStatus()
Gets the current status of this task.
|
long |
getTaskId()
Gets task ID.
|
void |
handleAlarm(Alarm alarm)
Handles alarm.
|
int |
hashCode()
Gets the hash code for this object.
|
void |
invoke(Timer timer) |
void |
start() |
java.lang.String |
toString() |
public TimerTask(EjbTimerContainer timerService, TimeoutInvoker invoker, EjbTimer task, CronExpression cronExpression, Trigger trigger, java.io.Serializable data)
targetBean
- The target bean to be invoked by the task.targetMethod
- The target method to be invoked by the task.task
- The task to be invoked.cronExpression
- The cron expression used to create the schedule, if any.trigger
- The trigger for the schedule.start
- The start date, in milliseconds for the scheduled task. -1 used to
indicate no start date.end
- The end date, in milliseconds for the scheduled task. -1 used to
indicate no end date.data
- The data to be passed to the invocation target.public void start()
public long getTaskId()
public CronExpression getCronExpression()
public java.io.Serializable getData()
public long getNextAlarmTime()
public void cancel()
public ScheduledTaskStatus getStatus()
public void invoke(Timer timer)
public void handleAlarm(Alarm alarm)
handleAlarm
in interface AlarmListener
alarm
- Alarm to handle.public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- The object to compare with.public java.lang.String toString()
toString
in class java.lang.Object