Package com.sun.identity.common
Class GeneralTaskRunnable
- java.lang.Object
-
- com.sun.identity.common.GeneralTaskRunnable
-
- All Implemented Interfaces:
TaskRunnable,Runnable
- Direct Known Subclasses:
CacheCleanUpRunnable,ClusterStateService,InstantRunnable,KeyStoreRefresher,PeriodicRunnable,POSTCleanUpRunnable,SessionCuller,TokenCleanupRunnable,WebtopNaming.SiteMonitor
public abstract class GeneralTaskRunnable extends Object implements TaskRunnable
An abstract class which works as a base class of scheduleable unit with the implementations of some functions of TaskRunnable interface.
-
-
Field Summary
Fields Modifier and Type Field Description protected HeadTaskRunnableheadTaskprotected TaskRunnablenextTaskprotected TaskRunnablepreviousTask
-
Constructor Summary
Constructors Constructor Description GeneralTaskRunnable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Implements for TaskRunnable interface.HeadTaskRunnablegetHeadTask()Returns the head task of this linkable TaskRunnable.booleanisScheduled()Returns true if this TaskRunnable is scheduled to run; otherwise returns false.TaskRunnablenext()Returns the TaskRunnable next to this TaskRunnable in the linked-list.TaskRunnableprevious()Returns the TaskRunnable previous to this TaskRunnable in the linked-list.longscheduledExecutionTime()Returns the scheduled time of this TaskRunnable.voidsetHeadTask(HeadTaskRunnable headTask)Sets the head task for this linkable TaskRunnable The head task of this TaskRunnable will be set.voidsetNext(TaskRunnable task)Sets the TaskRunnable next to this TaskRunnable in the linked-list.voidsetPrevious(TaskRunnable task)Sets the TaskRunnable previous to this TaskRunnable in the linked-list.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.identity.common.TaskRunnable
addElement, getRunPeriod, isEmpty, removeElement
-
-
-
-
Field Detail
-
nextTask
protected volatile TaskRunnable nextTask
-
previousTask
protected volatile TaskRunnable previousTask
-
headTask
protected volatile HeadTaskRunnable headTask
-
-
Method Detail
-
setHeadTask
public void setHeadTask(HeadTaskRunnable headTask)
Sets the head task for this linkable TaskRunnable The head task of this TaskRunnable will be set. HeadTask works as a lock when the elements of the linked task is going to be changed.- Specified by:
setHeadTaskin interfaceTaskRunnable- Parameters:
headTask- The HeadTaskRunnable
-
getHeadTask
public HeadTaskRunnable getHeadTask()
Returns the head task of this linkable TaskRunnable.- Specified by:
getHeadTaskin interfaceTaskRunnable- Returns:
- The head task of this linkable TaskRunnable
-
previous
public TaskRunnable previous()
Returns the TaskRunnable previous to this TaskRunnable in the linked-list. The correct HeadTaskRunnable must be locked before calling this function.- Specified by:
previousin interfaceTaskRunnable- Returns:
- previous TaskRunnable object or null if it is not set
-
next
public TaskRunnable next()
Returns the TaskRunnable next to this TaskRunnable in the linked-list. The correct HeadTaskRunnable must be locked before calling this function.- Specified by:
nextin interfaceTaskRunnable- Returns:
- next TaskRunnable object or null if it is not set
-
setPrevious
public void setPrevious(TaskRunnable task)
Sets the TaskRunnable previous to this TaskRunnable in the linked-list. The correct HeadTaskRunnable must be locked before calling this function.- Specified by:
setPreviousin interfaceTaskRunnable- Parameters:
task- The previous TaskRunnable
-
setNext
public void setNext(TaskRunnable task)
Sets the TaskRunnable next to this TaskRunnable in the linked-list. The correct HeadTaskRunnable must be locked before calling this function.- Specified by:
setNextin interfaceTaskRunnable- Parameters:
task- The next TaskRunnable
-
scheduledExecutionTime
public long scheduledExecutionTime()
Returns the scheduled time of this TaskRunnable.- Specified by:
scheduledExecutionTimein interfaceTaskRunnable- Returns:
- A long value indicate the time this TaskRunnable is scheduled, or -1 if it is not scheduled yet
-
isScheduled
public boolean isScheduled()
Returns true if this TaskRunnable is scheduled to run; otherwise returns false.- Returns:
- A boolean value indicating whether or not this TaskRunnable is scheduled.
-
cancel
public void cancel()
Implements for TaskRunnable interface. Cancels the task from the associated Timer.- Specified by:
cancelin interfaceTaskRunnable
-
-