Esempio n. 1
0
 @SuppressWarnings("unchecked")
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   entryPoints = (Map<EntryPointId, EntryPointNode>) in.readObject();
   kBase = ((DroolsObjectInputStream) in).getKnowledgeBase();
   for (Map.Entry<EntryPointId, EntryPointNode> entry : entryPoints.entrySet()) {
     EntryPointNode node = entry.getValue();
     if (node.getEntryPoint() == null) node.setEntryPoint(entry.getKey());
     kBase.registerAddedEntryNodeCache(node);
   }
   super.readExternal(in);
 }
Esempio n. 2
0
 /**
  * Adds the <code>ObjectSink</code> so that it may receive <code>Objects</code> propagated from
  * this <code>ObjectSource</code>.
  *
  * @param objectSink The <code>ObjectSink</code> to receive propagated <code>Objects</code>. Rete
  *     only accepts <code>ObjectTypeNode</code>s as parameters to this method, though.
  */
 public void addObjectSink(final ObjectSink objectSink) {
   final EntryPointNode node = (EntryPointNode) objectSink;
   entryPoints.put(node.getEntryPoint(), node);
   kBase.registerAddedEntryNodeCache(node);
 }