}
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
boolean isDrools = in instanceof DroolsObjectInputStream;
DroolsObjectInputStream droolsStream;
ByteArrayInputStream bytes;
if ( isDrools ) {
bytes = null;
droolsStream = (DroolsObjectInputStream) in;
} else {
bytes = new ByteArrayInputStream( (byte[]) in.readObject() );
droolsStream = new DroolsObjectInputStream( bytes );
}
this.rules = (Map<Rule, BaseNode[]>) droolsStream.readObject();
this.namedWindows = (Map<String, WindowNode>) droolsStream.readObject();
this.idGenerator = (IdGenerator) droolsStream.readObject();
this.ordered = droolsStream.readBoolean();
if ( !isDrools ) {
droolsStream.close();
bytes.close();
}
this.ruleBuilder = new ReteooRuleBuilder();
}