use of org.infinispan.registry.InternalCacheRegistry in project infinispan by infinispan.
the class CheckAddressTask method defineTopologyCacheConfig.
private void defineTopologyCacheConfig(EmbeddedCacheManager cacheManager) {
InternalCacheRegistry internalCacheRegistry = SecurityActions.getGlobalComponentRegistry(cacheManager).getComponent(InternalCacheRegistry.class);
internalCacheRegistry.registerInternalCache(configuration.topologyCacheName(), createTopologyCacheConfig(cacheManager.getCacheManagerConfiguration().transport().distributedSyncTimeout()).build(), EnumSet.of(InternalCacheRegistry.Flag.EXCLUSIVE));
}
use of org.infinispan.registry.InternalCacheRegistry in project infinispan by infinispan.
the class LifecycleCallbacks method registerGlobalTxTable.
/**
* Creates the global transaction internal cache.
*/
private void registerGlobalTxTable() {
InternalCacheRegistry registry = globalComponentRegistry.getComponent(InternalCacheRegistry.class);
ConfigurationBuilder builder = new ConfigurationBuilder();
// we can't lose transactions. distributed cache can lose data is num_owner nodes crash at the same time
// If this cache is changed from REPL/LOCAL it will also become blocking - and the blockhound exception in
// ServerHotrodBlockHoundIntegration will no longer be correct
builder.clustering().cacheMode(globalCfg.isClustered() ? CacheMode.REPL_SYNC : CacheMode.LOCAL);
builder.transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL);
// persistent? should we keep the transaction after restart?
registry.registerInternalCache(GLOBAL_TX_TABLE_CACHE_NAME, builder.build(), EnumSet.noneOf(InternalCacheRegistry.Flag.class));
}
use of org.infinispan.registry.InternalCacheRegistry in project infinispan by infinispan.
the class LifecycleCallbacks method cacheManagerStarting.
@Override
public void cacheManagerStarting(GlobalComponentRegistry gcr, GlobalConfiguration gc) {
SerializationContextRegistry ctxRegistry = gcr.getComponent(SerializationContextRegistry.class);
ctxRegistry.addContextInitializer(MarshallerType.PERSISTENCE, new org.infinispan.server.logging.events.PersistenceContextInitializerImpl());
ctxRegistry.addContextInitializer(MarshallerType.PERSISTENCE, new org.infinispan.server.state.PersistenceContextInitializerImpl());
EmbeddedCacheManager cacheManager = gcr.getComponent(EmbeddedCacheManager.class);
InternalCacheRegistry internalCacheRegistry = gcr.getComponent(InternalCacheRegistry.class);
internalCacheRegistry.registerInternalCache(ServerEventLogger.EVENT_LOG_CACHE, getTaskHistoryCacheConfiguration(cacheManager).build(), EnumSet.of(InternalCacheRegistry.Flag.PERSISTENT, InternalCacheRegistry.Flag.QUERYABLE));
// Install the new logger component
oldEventLogger = gcr.getComponent(EventLogManager.class).replaceEventLogger(new ServerEventLogger(cacheManager, gcr.getTimeService()));
}
use of org.infinispan.registry.InternalCacheRegistry in project infinispan by infinispan.
the class LifecycleManager method cacheStarting.
@Override
public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) {
InternalCacheRegistry icr = cr.getGlobalComponentRegistry().getComponent(InternalCacheRegistry.class);
if (!icr.isInternalCache(cacheName) || icr.internalCacheHasFlag(cacheName, Flag.QUERYABLE)) {
cr.registerComponent(new IndexStatisticsSnapshotImpl(), IndexStatistics.class);
cr.registerComponent(new LocalQueryStatistics(), LocalQueryStatistics.class);
cr.registerComponent(new SearchStatsRetriever(), SearchStatsRetriever.class);
AdvancedCache<?, ?> cache = cr.getComponent(Cache.class).getAdvancedCache();
ClassLoader aggregatedClassLoader = makeAggregatedClassLoader(cr.getGlobalComponentRegistry().getGlobalConfiguration().classLoader());
cr.registerComponent(new ReflectionMatcher(aggregatedClassLoader), ReflectionMatcher.class);
cr.registerComponent(new QueryEngine<>(cache), QueryEngine.class);
}
}
use of org.infinispan.registry.InternalCacheRegistry in project infinispan by infinispan.
the class HotRodSingleClusteredNonLoopbackTest method testNonLoopbackPutOnProtectedCache.
public void testNonLoopbackPutOnProtectedCache(Method m) {
InternalCacheRegistry internalCacheRegistry = manager(0).getGlobalComponentRegistry().getComponent(InternalCacheRegistry.class);
internalCacheRegistry.registerInternalCache("MyInternalCache", hotRodCacheConfiguration().build(), EnumSet.of(InternalCacheRegistry.Flag.USER, InternalCacheRegistry.Flag.PROTECTED));
TestResponse resp = hotRodClient.execute(0xA0, (byte) 0x01, "MyInternalCache", k(m), 0, 0, v(m), 0, (byte) 1, 0);
assertEquals(resp.status, Success, "Status should have been 'Success' but instead was: " + resp.status);
hotRodClient.assertPut(m);
}
Aggregations