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