Package jadex.tools.comanalyzer
Class RefreshTask
- java.lang.Object
- 
- java.util.TimerTask
- 
- jadex.tools.comanalyzer.RefreshTask
 
 
- 
- All Implemented Interfaces:
- java.lang.Runnable
 
 public class RefreshTask extends java.util.TimerTaskThe refresh task. This class invokes the messageAdded notification on a different awt thread and waits for its return to measure the duration for the update. With the duration list one can adjust the time for the refresh rate.
- 
- 
Constructor SummaryConstructors Constructor Description RefreshTask(ComanalyzerPlugin plugin, long period)Create a new RefreshTask.RefreshTask(ComanalyzerPlugin plugin, long period, java.util.List durations)Since TimerTasks cant be rescheduled, this constructor provides the possibility to pass the durationlist from an other task to this one.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel()Cancel the task.voidfireMessagesAdded(Message[] messages)This method is call by the plugin to pass the messages to be added.longgetAverageExecutionDuration(int number)protected java.util.ListgetDurations()longgetLastExecutionDuration()intgetMessageSize()protected longgetPeriod()booleanisCanceld()booleanisDone()voidrun()Invokes the messagesAdded notification on the awt thread and meseasures the duration.
 
- 
- 
- 
Constructor Detail- 
RefreshTaskpublic RefreshTask(ComanalyzerPlugin plugin, long period) Create a new RefreshTask.- Parameters:
- period- The period this task is scheduled in the timer.
- plugin- The ComanalyzerPlugin.
 
 - 
RefreshTaskpublic RefreshTask(ComanalyzerPlugin plugin, long period, java.util.List durations) Since TimerTasks cant be rescheduled, this constructor provides the possibility to pass the durationlist from an other task to this one.- Parameters:
- plugin- The ComanalyzerPlugin.
- period- The period this task is scheduled in the timer.
- durations- The passed durationlist.
 
 
- 
 - 
Method Detail- 
fireMessagesAddedpublic void fireMessagesAdded(Message[] messages) This method is call by the plugin to pass the messages to be added.- Parameters:
- messages- The messages to be added.
 
 - 
getMessageSizepublic int getMessageSize() - Returns:
- The message size.
 
 - 
cancelpublic boolean cancel() Cancel the task. If there are messages in the messagelist left, cancel it after the next run.- Overrides:
- cancelin class- java.util.TimerTask
 
 - 
runpublic void run() Invokes the messagesAdded notification on the awt thread and meseasures the duration.- Specified by:
- runin interface- java.lang.Runnable
- Specified by:
- runin class- java.util.TimerTask
 
 - 
isDonepublic boolean isDone() - Returns:
- trueif the task is done.
 
 - 
isCanceldpublic boolean isCanceld() - Returns:
- trueif the task is cancelled
 
 - 
getAverageExecutionDurationpublic long getAverageExecutionDuration(int number) - Parameters:
- number- The count of the last durations the average is calculated from.
- Returns:
- The average duration for the last numberexecutions.
 
 - 
getLastExecutionDurationpublic long getLastExecutionDuration() - Returns:
- The duration of the last execution.
 
 - 
getPeriodprotected long getPeriod() - Returns:
- The stored period for this task.
 
 - 
getDurationsprotected java.util.List getDurations() - Returns:
- The list of durations.
 
 
- 
 
-