for (ModuleCommandFactory factory : factories.values()) {
if (factory instanceof CacheCommandFactory)
return (CacheCommandFactory) factory;
}
throw new CacheException("Infinispan custom cache command factory not " +
"installed (possibly because the classloader where Infinispan " +
"lives couldn't find the Hibernate Infinispan cache provider)");
}