Search in sources :

Example 1 with CacheCommandFactory

use of org.hibernate.cache.infinispan.util.CacheCommandFactory in project hibernate-orm by hibernate.

the class InfinispanRegionFactory method getCacheCommandFactory.

private CacheCommandFactory getCacheCommandFactory() {
    final GlobalComponentRegistry globalCr = manager.getGlobalComponentRegistry();
    final Map<Byte, ModuleCommandFactory> factories = (Map<Byte, ModuleCommandFactory>) globalCr.getComponent("org.infinispan.modules.command.factories");
    for (ModuleCommandFactory factory : factories.values()) {
        if (factory instanceof CacheCommandFactory) {
            return (CacheCommandFactory) factory;
        }
    }
    throw log.cannotInstallCommandFactory();
}
Also used : ModuleCommandFactory(org.infinispan.commands.module.ModuleCommandFactory) CacheCommandFactory(org.hibernate.cache.infinispan.util.CacheCommandFactory) GlobalComponentRegistry(org.infinispan.factories.GlobalComponentRegistry) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 CacheCommandFactory (org.hibernate.cache.infinispan.util.CacheCommandFactory)1 ModuleCommandFactory (org.infinispan.commands.module.ModuleCommandFactory)1 GlobalComponentRegistry (org.infinispan.factories.GlobalComponentRegistry)1