01: package org.drools.reteoo;
02:
03: import org.drools.common.InternalFactHandle;
04: import org.drools.common.InternalWorkingMemory;
05: import org.drools.spi.PropagationContext;
06:
07: public class SingleObjectSinkAdapter implements ObjectSinkPropagator {
08:
09: private ObjectSink sink;
10:
11: public SingleObjectSinkAdapter(final ObjectSink sink) {
12: this .sink = sink;
13: }
14:
15: public void propagateAssertObject(final InternalFactHandle handle,
16: final PropagationContext context,
17: final InternalWorkingMemory workingMemory) {
18: this .sink.assertObject(handle, context, workingMemory);
19:
20: }
21:
22: public void propagateRetractObject(final InternalFactHandle handle,
23: final PropagationContext context,
24: final InternalWorkingMemory workingMemory,
25: final boolean useHash) {
26: this .sink.retractObject(handle, context, workingMemory);
27:
28: }
29:
30: public ObjectSink[] getSinks() {
31: return new ObjectSink[] { this.sink };
32: }
33:
34: }
|