[jboss-jira] [JBoss JIRA] Updated: (JBRULES-2365) PseudoClockScheduler removal does not work

Barry Kaplan (JIRA) jira-events at lists.jboss.org
Mon Dec 7 22:09:30 EST 2009


     [ https://jira.jboss.org/jira/browse/JBRULES-2365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Barry Kaplan updated JBRULES-2365:
----------------------------------

    Attachment: PseudoClockSchedulerTest.java


For the last two test runCallbacks() needs to be:

{code}
    private void runCallBacks() {
        ScheduledJob item = queue.peek();
        long fireTime;
        while ( item != null && ((fireTime = item.getTrigger().hasNextFireTime().getTime()) <= this.timer) ) {
            // remove the head
            queue.remove();
            
            // updates the trigger
            item.getTrigger().nextFireTime();
            
            if ( item.getTrigger().hasNextFireTime() != null ) {
                // reschedule for the next fire time, if one exists
                queue.add( item );               
            }
            // save the current timer because we are going to override to to the job's trigger time
            long savedTimer = this.timer;
            try {
                // set the clock back to the trigger's fire time
                this.timer = fireTime;
                // execute the call
                item.call();
            } catch ( Exception e ) {
                e.printStackTrace(); //SMELL This is pretty bad
            } finally {
                this.timer = savedTimer;
            }
            // get next head
            item = queue.peek();
        }
    }
{code}

> PseudoClockScheduler removal does not work
> ------------------------------------------
>
>                 Key: JBRULES-2365
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2365
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: Mark Proctor
>            Assignee: Mark Proctor
>         Attachments: PseudoClockSchedulerTest.java
>
>
> With PseudoClockScheduler it adds to the PriorityQueue with ScheduledJob, but tries to remove with JobHandle. We need to make the JobHandle be able to return the ScheduledJob.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list