| java.lang.Object org.apache.jmeter.threads.ListenerNotifier
ListenerNotifier | public class ListenerNotifier (Code) | | The ListenerNotifier thread is responsible for performing
asynchronous notifications that a sample has occurred. Each time a sample
occurs, the addLast method should be called to add the sample
and its list of listeners to the notification queue. This thread will then
notify those listeners asynchronously at some future time.
In the current implementation, the notifications will be made in batches,
with 2 seconds between the beginning of successive batches. If the notifier
thread starts to get behind, the priority of the thread will be increased in
an attempt to help it to keep up.
See Also: org.apache.jmeter.samplers.SampleListener version: $Revision: 493779 $ |
Method Summary | |
public void | addLast(SampleEvent item, List listeners) Add a new sample event to the notification queue. | public boolean | isStopped() Indicates whether or not the thread has stopped. | public void | notifyListeners(SampleEvent res, List listeners) Notify a list of listeners that a sample has occurred.
Parameters: res - the sample event that has occurred. | public void | run() Process the events in the notification queue until the thread has been
told to stop and the notification queue is empty.
In the current implementation, this method will iterate continually until
the thread is told to stop. | public void | stop() Stops the ListenerNotifier thread. |
addLast | public void addLast(SampleEvent item, List listeners)(Code) | | Add a new sample event to the notification queue. The notification will
be performed asynchronously and this method will return immediately.
Parameters: item - the sample event that has occurred. Must be non-null. Parameters: listeners - a list of the listeners which should be notified. This listmust not be null and must contain only SampleListenerelements. |
isStopped | public boolean isStopped()(Code) | | Indicates whether or not the thread has stopped. This will not return
true until the stop method has been called and any
remaining notifications in the queue have been completed.
true if the ListenerNotifier has completely stopped, falseotherwise |
notifyListeners | public void notifyListeners(SampleEvent res, List listeners)(Code) | | Notify a list of listeners that a sample has occurred.
Parameters: res - the sample event that has occurred. Must be non-null. Parameters: listeners - a list of the listeners which should be notified. This listmust not be null and must contain only SampleListenerelements. |
run | public void run()(Code) | | Process the events in the notification queue until the thread has been
told to stop and the notification queue is empty.
In the current implementation, this method will iterate continually until
the thread is told to stop. In each iteration it will process any
notifications that are in the queue at the beginning of the iteration,
and then will sleep until it is time to start the next batch. As long as
the thread is keeping up, each batch should start 2 seconds after the
beginning of the last batch. This exact behavior is subject to change.
|
stop | public void stop()(Code) | | Stops the ListenerNotifier thread. The thread will continue processing
any events remaining in the notification queue before it actually stops,
but this method will return immediately.
|
|
|