/**
  * Constructor specifying the unique id of the node in the Rete network, the position of the propagating <code>FactHandleImpl</code> in
  * <code>ReteTuple</code> and the source that propagates the receive <code>ReteTuple<code>s.
  *
  * @param id
  *      Unique id
  * @param source
  *      The <code>TupleSource</code> which propagates the received <code>ReteTuple</code>
  */
 public RightInputAdapterNode(
     final int id, final LeftTupleSource source, final BuildContext context) {
   super(
       id,
       context.getPartitionId(),
       context.getRuleBase().getConfiguration().isMultithreadEvaluation());
   this.tupleSource = source;
   this.tupleMemoryEnabled = context.isTupleMemoryEnabled();
 }
示例#2
0
 public EntryPointNode(final int id, final ObjectSource objectSource, final BuildContext context) {
   this(
       id,
       context.getPartitionId(),
       context.getRuleBase().getConfiguration().isMultithreadEvaluation(),
       objectSource,
       context
           .getCurrentEntryPoint()); // irrelevant for this node, since it overrides sink
                                     // management
 }
 /**
  * Constructus a LeftInputAdapterNode with a unique id that receives <code>FactHandle</code> from
  * a parent <code>ObjectSource</code> and adds it to a given pattern in the resulting Tuples.
  *
  * @param id The unique id of this node in the current Rete network
  * @param source The parent node, where Facts are propagated from
  */
 public LeftInputAdapterNode(final int id, final ObjectSource source, final BuildContext context) {
   super(
       id,
       context.getPartitionId(),
       context.getRuleBase().getConfiguration().isMultithreadEvaluation());
   this.objectSource = source;
   this.leftTupleMemoryEnabled = context.isTupleMemoryEnabled();
   ObjectSource current = source;
   while (!(current instanceof ObjectTypeNode)) {
     current = current.getParentObjectSource();
   }
   ObjectTypeNode otn = (ObjectTypeNode) current;
   rootQueryNode = ClassObjectType.DroolsQuery_ObjectType.isAssignableFrom(otn.getObjectType());
 }
 /**
  * Construct given a semantic <code>ObjectType</code> and the provided unique id. All <code>
  * ObjectTypdeNode</code> have node memory.
  *
  * @param id The unique id for the node.
  * @param objectType The semantic object-type differentiator.
  */
 public ObjectTypeNode(
     final int id,
     final EntryPointNode source,
     final ObjectType objectType,
     final BuildContext context) {
   super(
       id,
       context.getPartitionId(),
       context.getRuleBase().getConfiguration().isMultithreadEvaluation(),
       source,
       context.getRuleBase().getConfiguration().getAlphaNodeHashingThreshold());
   this.objectType = objectType;
   setObjectMemoryEnabled(context.isObjectTypeNodeMemoryEnabled());
 }
示例#5
0
 /**
  * Construct.
  *
  * @param id The unique id for this node.
  * @param leftInput The left input <code>TupleSource</code>.
  * @param rightInput The right input <code>ObjectSource</code>.
  * @param joinNodeBinder The constraints to be applied to the right objects
  */
 public ExistsNode(
     final int id,
     final LeftTupleSource leftInput,
     final ObjectSource rightInput,
     final BetaConstraints joinNodeBinder,
     final BuildContext context) {
   super(
       id,
       context.getPartitionId(),
       context.getRuleBase().getConfiguration().isMultithreadEvaluation(),
       leftInput,
       rightInput,
       joinNodeBinder,
       context);
   this.tupleMemoryEnabled = context.isTupleMemoryEnabled();
 }
示例#6
0
 public QueryElementNode(
     final int id,
     final LeftTupleSource tupleSource,
     final QueryElement queryElement,
     final boolean tupleMemoryEnabled,
     final boolean openQuery,
     final BuildContext context) {
   super(
       id,
       context.getPartitionId(),
       context.getRuleBase().getConfiguration().isMultithreadEvaluation());
   this.tupleSource = tupleSource;
   this.queryElement = queryElement;
   this.tupleMemoryEnabled = tupleMemoryEnabled;
   this.openQuery = openQuery;
   initMasks(context, tupleSource);
 }
示例#7
0
  /**
   * Construct given a semantic <code>ObjectType</code> and the provided unique id. All <code>
   * ObjectTypdeNode</code> have node memory.
   *
   * @param id The unique id for the node.
   * @param objectType The semantic object-type differentiator.
   */
  public ObjectTypeNode(
      final int id,
      final EntryPointNode source,
      final ObjectType objectType,
      final BuildContext context) {
    super(
        id,
        context.getPartitionId(),
        context.getRuleBase().getConfiguration().isMultithreadEvaluation(),
        source,
        context.getRuleBase().getConfiguration().getAlphaNodeHashingThreshold());
    this.objectType = objectType;
    this.lrUnlinkingEnabled = context.getRuleBase().getConfiguration().isLRUnlinkingEnabled();
    setObjectMemoryEnabled(context.isObjectTypeNodeMemoryEnabled());

    if (ClassObjectType.DroolsQuery_ObjectType.isAssignableFrom(objectType)) {
      queryNode = true;
    }
  }
示例#8
0
 public AccumulateNode(
     final int id,
     final LeftTupleSource leftInput,
     final ObjectSource rightInput,
     final AlphaNodeFieldConstraint[] resultConstraints,
     final BetaConstraints sourceBinder,
     final BetaConstraints resultBinder,
     final Accumulate accumulate,
     final boolean unwrapRightObject,
     final BuildContext context) {
   super(
       id,
       context.getPartitionId(),
       context.getRuleBase().getConfiguration().isMultithreadEvaluation(),
       leftInput,
       rightInput,
       sourceBinder,
       context);
   this.resultBinder = resultBinder;
   this.resultConstraints = resultConstraints;
   this.accumulate = accumulate;
   this.unwrapRightObject = unwrapRightObject;
   this.tupleMemoryEnabled = context.isTupleMemoryEnabled();
 }