01: /**
02: *
03: */package org.drools.concurrent;
04:
05: import org.drools.WorkingMemory;
06: import org.drools.spi.AgendaFilter;
07:
08: public class FireAllRules implements Command, Future {
09: private AgendaFilter agendaFilter;
10: private volatile boolean done;
11: private Exception e;
12:
13: public FireAllRules(final AgendaFilter agendaFilter) {
14: this .agendaFilter = agendaFilter;
15: }
16:
17: public void execute(final WorkingMemory workingMemory) {
18: try {
19: workingMemory.fireAllRules(this .agendaFilter);
20: } catch (Exception e) {
21: this .e = e;
22: }
23: this .done = true;
24: }
25:
26: public Object getObject() {
27: return null;
28: }
29:
30: public boolean isDone() {
31: return this .done;
32: }
33:
34: public boolean exceptionThrown() {
35: return e != null;
36: }
37:
38: public Exception getException() {
39: return this.e;
40: }
41: }
|