boolean isMultiKey = factory.getContextDetailPartitionItems().get(0).getPropertyNames().size() > 1;
if (contextPartitionSelector instanceof ContextPartitionSelectorFiltered) {
List<Integer> ids = new ArrayList<Integer>();
ContextPartitionSelectorFiltered filtered = (ContextPartitionSelectorFiltered) contextPartitionSelector;
ContextPartitionIdentifierPartitioned identifier = new ContextPartitionIdentifierPartitioned();
for (Map.Entry<Object, ContextControllerInstanceHandle> entry : partitionKeys.entrySet()) {
identifier.setContextPartitionId(entry.getValue().getContextPartitionOrPathId());
if (isMultiKey) {
identifier.setKeys(((MultiKeyUntyped)entry.getKey()).getKeys());
}
else {
identifier.setKeys(new Object[] {entry.getKey()});
}
if (filtered.filter(identifier)) {
ids.add(entry.getValue().getContextPartitionOrPathId());
}