Collection<FactHandle> disconnectedFactHandles = new ArrayList<FactHandle>();
if ( filter != null ) {
Collection<InternalFactHandle> factHandles = ksession.getFactHandles( this.filter );
if(factHandles != null && disconnected){
for(InternalFactHandle factHandle: factHandles){
InternalFactHandle handle = factHandle.clone();
handle.disconnect();
disconnectedFactHandles.add(handle);
}
return disconnectedFactHandles;
}
else {
return ksession.getFactHandles( this.filter );
}
} else {
Collection<InternalFactHandle> factHandles = ksession.getFactHandles( );
if(factHandles != null && disconnected){
for(InternalFactHandle factHandle: factHandles){
InternalFactHandle handle = factHandle.clone();
handle.disconnect();
disconnectedFactHandles.add(handle);
}
return disconnectedFactHandles;
}
else {