Crossfire JXClient, Trunk
|
Public Member Functions | |
boolean | cancel () |
void | run () |
Package Functions | |
SessionTask (long scheduleNext) | |
Package Attributes | |
volatile boolean | cancelled =false |
final long | delayBeforeNext |
final long | taskid |
Private Member Functions | |
boolean | execute () |
boolean | notifyStateChange (ScanState newState, String condition) |
boolean | scheduleNext () |
A session task will be scheduled to run in background in a timer thread. There can be at most one session task running at a given time (this is ensured by using a timer - which is a single threaded object).
If the session needs to be repeated, it will reschedule an identical session when it finishes to run. This ensure that two session runs are separated by the given interval time.
Definition at line 762 of file ScanManager.java.
|
package |
create a new SessionTask.
Definition at line 784 of file ScanManager.java.
References com.sun.jmx.examples.scandir.ScanManager.SessionTask.delayBeforeNext, com.sun.jmx.examples.scandir.ScanManager.SessionTask.scheduleNext(), com.sun.jmx.examples.scandir.ScanManager.taskcount, and com.sun.jmx.examples.scandir.ScanManager.SessionTask.taskid.
Referenced by com.sun.jmx.examples.scandir.ScanManager.SessionTask.scheduleNext().
boolean com.sun.jmx.examples.scandir.ScanManager.SessionTask.cancel | ( | ) |
Definition at line 813 of file ScanManager.java.
References com.sun.jmx.examples.scandir.ScanManager.SessionTask.cancelled.
|
private |
Invoke all directories scanners in sequence. At each step, checks to see whether the task should stop.
Definition at line 822 of file ScanManager.java.
References com.sun.jmx.examples.scandir.ScanManager.SessionTask.cancelled, com.sun.jmx.examples.scandir.ScanManager.LOG, com.sun.jmx.examples.scandir.ScanManager.SessionTask.notifyStateChange(), com.sun.jmx.examples.scandir.ScanManager.scanAllDirectories(), and com.sun.jmx.examples.scandir.ScanManager.SessionTask.taskid.
Referenced by com.sun.jmx.examples.scandir.ScanManager.SessionTask.run().
|
private |
When run() begins, the state is switched to RUNNING. When run() ends then: If the task is repeated, the state will be switched to SCHEDULED (because a new task was scheduled). Otherwise the state will be switched to either STOPPED (if it was stopped before it could complete) or COMPLETED (if it completed gracefully) This method is used to switch to the desired state and send the appropriate notifications. When entering the method, we check whether the state is STOPPED. If so, we return false - and the SessionTask will stop. Otherwise, we switch the state to the desired value.
Definition at line 803 of file ScanManager.java.
References com.sun.jmx.examples.scandir.ScanManager.sendQueuedNotifications(), com.sun.jmx.examples.scandir.ScanManager.state, and com.sun.jmx.examples.scandir.ScanManager.switchState().
Referenced by com.sun.jmx.examples.scandir.ScanManager.SessionTask.execute(), com.sun.jmx.examples.scandir.ScanManager.SessionTask.run(), and com.sun.jmx.examples.scandir.ScanManager.SessionTask.scheduleNext().
void com.sun.jmx.examples.scandir.ScanManager.SessionTask.run | ( | ) |
The run method: executes scanning logic, the schedule next iteration if needed.
Definition at line 877 of file ScanManager.java.
References com.sun.jmx.examples.scandir.ScanManager.SessionTask.delayBeforeNext, com.sun.jmx.examples.scandir.ScanManager.SessionTask.execute(), com.sun.jmx.examples.scandir.ScanManager.LOG, com.sun.jmx.examples.scandir.ScanManager.SessionTask.notifyStateChange(), com.sun.jmx.examples.scandir.ScanManager.SessionTask.scheduleNext(), com.sun.jmx.examples.scandir.ScanManager.state, com.sun.jmx.examples.scandir.ScanManager.SessionTask.taskid, and com.sun.jmx.examples.scandir.ScanManager.tasklist.
|
private |
Schedule an identical task for next iteration.
Definition at line 848 of file ScanManager.java.
References com.sun.jmx.examples.scandir.ScanManager.SessionTask.cancelled, com.sun.jmx.examples.scandir.ScanManager.SessionTask.delayBeforeNext, com.sun.jmx.examples.scandir.ScanManager.LOG, com.sun.jmx.examples.scandir.ScanManager.SessionTask.notifyStateChange(), com.sun.jmx.examples.scandir.ScanManager.scheduleSession(), com.sun.jmx.examples.scandir.ScanManager.SessionTask.SessionTask(), and com.sun.jmx.examples.scandir.ScanManager.SessionTask.taskid.
Referenced by com.sun.jmx.examples.scandir.ScanManager.SessionTask.run(), and com.sun.jmx.examples.scandir.ScanManager.SessionTask.SessionTask().
|
package |
Whether it's been cancelled by stop()
Definition at line 779 of file ScanManager.java.
Referenced by com.sun.jmx.examples.scandir.ScanManager.SessionTask.cancel(), com.sun.jmx.examples.scandir.ScanManager.SessionTask.execute(), and com.sun.jmx.examples.scandir.ScanManager.SessionTask.scheduleNext().
|
package |
Delay after which the next iteration of this task will start. This delay is measured starting at the end of the previous iteration.
Definition at line 769 of file ScanManager.java.
Referenced by com.sun.jmx.examples.scandir.ScanManager.SessionTask.run(), com.sun.jmx.examples.scandir.ScanManager.SessionTask.scheduleNext(), and com.sun.jmx.examples.scandir.ScanManager.SessionTask.SessionTask().
|
package |
A unique id for this task.
Definition at line 774 of file ScanManager.java.
Referenced by com.sun.jmx.examples.scandir.ScanManager.SessionTask.execute(), com.sun.jmx.examples.scandir.ScanManager.SessionTask.run(), com.sun.jmx.examples.scandir.ScanManager.SessionTask.scheduleNext(), and com.sun.jmx.examples.scandir.ScanManager.SessionTask.SessionTask().