Package org.drools.ancompiler
Class CompiledNetwork
- java.lang.Object
-
- org.drools.ancompiler.CompiledNetwork
-
- All Implemented Interfaces:
Externalizable,Serializable,org.drools.core.reteoo.ObjectSinkPropagator
public abstract class CompiledNetwork extends Object implements org.drools.core.reteoo.ObjectSinkPropagator
This is the base type for all generated classes that that represent a "compiled" portion of the RETE network. By compiled we mean IF statements, switch statements, etc. as opposed to nodes, propagators, etc.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.drools.core.reteoo.ObjectTypeNodeobjectTypeNodeprotected org.drools.core.reteoo.ObjectSinkPropagatororiginalSinkPropagator
-
Constructor Summary
Constructors Constructor Description CompiledNetwork()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.drools.core.reteoo.ObjectSinkPropagatoraddObjectSink(org.drools.core.reteoo.ObjectSink sink, int alphaNodeHashingThreshold, int alphaNodeRangeIndexThreshold)voidchangeSinkPartition(org.drools.core.reteoo.ObjectSink sink, org.drools.core.common.RuleBasePartitionId oldPartition, org.drools.core.common.RuleBasePartitionId newPartition, int alphaNodeHashingThreshold, int alphaNodeRangeIndexThreshold)NetworkHandlerAdaptorcreateNodeReferenceSetter()voiddoLinkRiaNode(org.drools.core.common.InternalWorkingMemory wm)voiddoUnlinkRiaNode(org.drools.core.common.InternalWorkingMemory wm)intgetId()Returns the unique id that represents the node in the Rete networkorg.drools.core.common.BaseNodegetMatchingNode(org.drools.core.common.BaseNode candidate)org.drools.core.reteoo.ObjectSinkPropagatorgetOriginalSinkPropagator()org.drools.core.common.RuleBasePartitionIdgetPartitionId()Returns the partition ID to which this node belongs toorg.drools.core.reteoo.ObjectSink[]getSinks()abstract voidinit(Object... args)voidinitConstraintsResults()Use to initialize the inlined expression so that the ANC can instantiate without depending on the Rete.booleanisEmpty()protected abstract booleanisInlined()voidreadExternal(ObjectInput in)The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.org.drools.core.reteoo.ObjectSinkPropagatorremoveObjectSink(org.drools.core.reteoo.ObjectSink sink)protected abstract voidsetNetworkNodeReference(org.drools.core.common.NetworkNode networkNode)Generated subclasses need to implement this method to set member variables based on the specified NetworkNode.voidsetObjectTypeNode(org.drools.core.reteoo.ObjectTypeNode objectTypeNode)Sets the OTN for this network.voidsetOriginalSinkPropagator(org.drools.core.reteoo.ObjectSinkPropagator originalSinkPropagator)voidsetStartingObjectTypeNode(org.drools.core.reteoo.ObjectTypeNode objectTypeNode)intsize()voidwriteExternal(ObjectOutput out)The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
-
-
-
Method Detail
-
getId
public int getId()
Returns the unique id that represents the node in the Rete network- Returns:
- unique int value
-
getPartitionId
public org.drools.core.common.RuleBasePartitionId getPartitionId()
Returns the partition ID to which this node belongs to- Returns:
- partition id
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.- Specified by:
writeExternalin interfaceExternalizable- Parameters:
out- the stream to write the object to- Throws:
IOException- Includes any I/O exceptions that may occur
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.- Specified by:
readExternalin interfaceExternalizable- Parameters:
in- the stream to read data from in order to restore the object- Throws:
IOException- if I/O errors occurClassNotFoundException- If the class for an object being restored cannot be found.
-
setObjectTypeNode
public final void setObjectTypeNode(org.drools.core.reteoo.ObjectTypeNode objectTypeNode)
Sets the OTN for this network. Calling this method will set all variables in the generated subclasses by walking theorg.kie.reteoo.ObjectTypeNodeusing aObjectTypeNodeParser.- Parameters:
objectTypeNode- node for whom this network was created
-
setStartingObjectTypeNode
public void setStartingObjectTypeNode(org.drools.core.reteoo.ObjectTypeNode objectTypeNode)
-
setOriginalSinkPropagator
public void setOriginalSinkPropagator(org.drools.core.reteoo.ObjectSinkPropagator originalSinkPropagator)
-
getOriginalSinkPropagator
public org.drools.core.reteoo.ObjectSinkPropagator getOriginalSinkPropagator()
-
setNetworkNodeReference
protected abstract void setNetworkNodeReference(org.drools.core.common.NetworkNode networkNode)
Generated subclasses need to implement this method to set member variables based on the specified NetworkNode.- Parameters:
networkNode- node to set to set
-
initConstraintsResults
public void initConstraintsResults()
Use to initialize the inlined expression so that the ANC can instantiate without depending on the Rete. Should be used instead of #setNetworkNodeReference See #isInlined
-
isInlined
protected abstract boolean isInlined()
-
createNodeReferenceSetter
public NetworkHandlerAdaptor createNodeReferenceSetter()
-
addObjectSink
public org.drools.core.reteoo.ObjectSinkPropagator addObjectSink(org.drools.core.reteoo.ObjectSink sink, int alphaNodeHashingThreshold, int alphaNodeRangeIndexThreshold)- Specified by:
addObjectSinkin interfaceorg.drools.core.reteoo.ObjectSinkPropagator
-
removeObjectSink
public org.drools.core.reteoo.ObjectSinkPropagator removeObjectSink(org.drools.core.reteoo.ObjectSink sink)
- Specified by:
removeObjectSinkin interfaceorg.drools.core.reteoo.ObjectSinkPropagator
-
changeSinkPartition
public void changeSinkPartition(org.drools.core.reteoo.ObjectSink sink, org.drools.core.common.RuleBasePartitionId oldPartition, org.drools.core.common.RuleBasePartitionId newPartition, int alphaNodeHashingThreshold, int alphaNodeRangeIndexThreshold)- Specified by:
changeSinkPartitionin interfaceorg.drools.core.reteoo.ObjectSinkPropagator
-
getMatchingNode
public org.drools.core.common.BaseNode getMatchingNode(org.drools.core.common.BaseNode candidate)
- Specified by:
getMatchingNodein interfaceorg.drools.core.reteoo.ObjectSinkPropagator
-
getSinks
public org.drools.core.reteoo.ObjectSink[] getSinks()
- Specified by:
getSinksin interfaceorg.drools.core.reteoo.ObjectSinkPropagator
-
size
public int size()
- Specified by:
sizein interfaceorg.drools.core.reteoo.ObjectSinkPropagator
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceorg.drools.core.reteoo.ObjectSinkPropagator
-
doLinkRiaNode
public void doLinkRiaNode(org.drools.core.common.InternalWorkingMemory wm)
- Specified by:
doLinkRiaNodein interfaceorg.drools.core.reteoo.ObjectSinkPropagator
-
doUnlinkRiaNode
public void doUnlinkRiaNode(org.drools.core.common.InternalWorkingMemory wm)
- Specified by:
doUnlinkRiaNodein interfaceorg.drools.core.reteoo.ObjectSinkPropagator
-
init
public abstract void init(Object... args)
-
-