private static Cache<String, UserSession> getCache()
    {
        // before the first use the Entity used for indexing must be added
        if (!((EmbeddedCacheManager) InfinispanCache.get().getContainer()).cacheExists(RegistryManager.SESSIONCACHE)) {
            final Configuration config = ((EmbeddedCacheManager) InfinispanCache.get().getContainer())
                            .getCacheConfiguration(RegistryManager.SESSIONCACHE);
            final ConfigurationBuilder bldr = new ConfigurationBuilder().read(config);
            bldr.indexing().addIndexedEntity(UserSession.class);
            ((EmbeddedCacheManager) InfinispanCache.get().getContainer()).undefineConfiguration(
                            RegistryManager.SESSIONCACHE);

            ((EmbeddedCacheManager) InfinispanCache.get().getContainer()).defineConfiguration(
                            RegistryManager.SESSIONCACHE, bldr.build());
        }
        return InfinispanCache.get().getIgnReCache(RegistryManager.SESSIONCACHE);
    }
private static Cache<String, UserSession> getCache()
    {
        
        if (!((EmbeddedCacheManager) InfinispanCache.get().getContainer()).cacheExists(RegistryManager.SESSIONCACHE)) {
            final Configuration config = ((EmbeddedCacheManager) InfinispanCache.get().getContainer())
                            .getCacheConfiguration(RegistryManager.SESSIONCACHE);
            final ConfigurationBuilder bldr = new ConfigurationBuilder().read(config);
            bldr.indexing().addIndexedEntity(UserSession.class);
            ((EmbeddedCacheManager) InfinispanCache.get().getContainer()).undefineConfiguration(
                            RegistryManager.SESSIONCACHE);

            ((EmbeddedCacheManager) InfinispanCache.get().getContainer()).defineConfiguration(
                            RegistryManager.SESSIONCACHE, bldr.build());
        }
        return InfinispanCache.get().getIgnReCache(RegistryManager.SESSIONCACHE);
    }
private static Cache < String , UserSession > getCache ( ) { // before the first use the Entity used for indexing must be added if ( ! ( ( EmbeddedCacheManager ) InfinispanCache . get ( ) . getContainer ( ) ) . cacheExists ( RegistryManager . SESSIONCACHE ) ) { final Configuration config = ( ( EmbeddedCacheManager ) InfinispanCache . get ( ) . getContainer ( ) ) . getCacheConfiguration ( RegistryManager . SESSIONCACHE ) ; final ConfigurationBuilder bldr = new ConfigurationBuilder ( ) . read ( config ) ; bldr . indexing ( ) . addIndexedEntity ( UserSession . class ) ; ( ( EmbeddedCacheManager ) InfinispanCache . get ( ) . getContainer ( ) ) . undefineConfiguration ( RegistryManager . SESSIONCACHE ) ; ( ( EmbeddedCacheManager ) InfinispanCache . get ( ) . getContainer ( ) ) . defineConfiguration ( RegistryManager . SESSIONCACHE , bldr . build ( ) ) ; } return InfinispanCache . get ( ) . getIgnReCache ( RegistryManager . SESSIONCACHE ) ; }
Gets the cache.

@return the cache
Gets the cache .