01: package org.drools;
02:
03: import java.util.Collection;
04: import java.util.List;
05:
06: import org.drools.concurrent.Future;
07: import org.drools.spi.AgendaFilter;
08:
09: /**
10: * A stateful session represents a working memory which keeps state
11: * between invocations (accumulating facts/knowledge).
12: *
13: * Caution should be used when using the async methods (take not of the javadocs for specific methods).
14: */
15: public interface StatefulSession extends WorkingMemory {
16:
17: /**
18: * Forces the workingMemory to be derefenced from
19: *
20: */
21: void dispose();
22:
23: /**
24: * Insert/Assert an object asynchronously.
25: * (return immediately, even while the insertion is taking effect).
26: * The returned Future object can be queried to check on the status of the task.
27: * You should only use the async methods if you are sure you require a background
28: * insertion task to take effect (a new thread may be created).
29: * If you are not sure, then you probably don't need to use it !
30: */
31: Future asyncInsert(Object object);
32:
33: Future asyncRetract(FactHandle factHandle);
34:
35: Future asyncUpdate(FactHandle factHandle, Object object);
36:
37: /**
38: * Insert/Assert an array of objects..
39: * (return immediately, even while the insertion is taking effect).
40: * The returned Future object can be queried to check on the status of the task.
41: * You should only use the async methods if you are sure you require a background
42: * insertion task to take effect (a new thread may be created).
43: * If you are not sure, then you probably don't need to use it !
44: */
45: Future asyncInsert(Object[] array);
46:
47: /**
48: * Insert/Assert a collect of objects..
49: * (return immediately, even while the insertion is taking effect).
50: * The returned Future object can be queried to check on the status of the task.
51: * You should only use the async methods if you are sure you require a background
52: * insertion task to take effect (a new thread may be created).
53: * If you are not sure, then you probably don't need to use it !
54: */
55: Future asyncInsert(Collection collect);
56:
57: /**
58: * This will initiate the firing phase (in the background).
59: * And return immediately. The returned Future object can be queried
60: * to check on the status of the task.
61: */
62: Future asyncFireAllRules();
63:
64: /**
65: * This will initiate the firing phase (in the background).
66: * And return immediately. The returned Future object can be queried
67: * to check on the status of the task.
68: */
69: Future asyncFireAllRules(AgendaFilter agendaFilter);
70:
71: }
|