public class CmsValidationScheduler
extends java.lang.Object
Since validations can be asynchronous, it would be possible for a validation to start while another one is still waiting for a response from the server if it were ran directly. This might result in an inconsistent state of the form fields being validated. To prevent this, validation controllers use this class to schedule validations, and call this class again after they're finished to execute the next validation.
The result of this is that a validation will only start after all unfinished validations which have been scheduled before it have finished running.
限定符 | 构造器和说明 |
---|---|
protected |
CmsValidationScheduler()
Hidden default constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
executeNext()
This method should be called by the validation controller when it has finished running.
|
static CmsValidationScheduler |
get()
Returns the singleton instance of the validation scheduler.
|
void |
schedule(CmsValidationController action)
This schedules a new validation to be run after all currently scheduled or running validations have finished.
|
public static CmsValidationScheduler get()
public void executeNext()
It will execute the next validation if there is one.
public void schedule(CmsValidationController action)
If there are no validations running, the validation will be started immediately.
action
- the validation to be scheduled