Maarten Lankhorst : quartz: Get rid of code duplication and add a flush method.