/** * @see InitializingBean#afterPropertiesSet() */ @Override public void afterPropertiesSet() throws Exception { logger.info("Initializing Infinispan EmbeddedCacheManager instance ..."); this.cacheManager = createBackingEmbeddedCacheManager(); logger.info("Successfully initialized Infinispan EmbeddedCacheManager instance [" + this.cacheManager + "]"); }
/** * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ @Override public void afterPropertiesSet() throws Exception { logger.info("Initializing Infinispan EmbeddedCacheManager instance ..."); this.cacheManager = createBackingEmbeddedCacheManager(); logger.info("Successfully initialized Infinispan EmbeddedCacheManager instance [" + this.cacheManager + "]"); }
/** * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ @Override public void afterPropertiesSet() throws Exception { if (this.infinispanCacheContainer == null) { throw new IllegalStateException("No Infinispan CacheContainer has been set"); } this.logger.info("Initializing named Infinispan cache ..."); this.infinispanCache = this.infinispanCacheContainer.getCache(); this.logger.info("New Infinispan cache [" + this.infinispanCache + "] initialized"); }
/** * @see InitializingBean#afterPropertiesSet() */ @Override public void afterPropertiesSet() throws Exception { logger.info("Initializing SpringEmbeddedCacheManager instance ..."); final EmbeddedCacheManager nativeEmbeddedCacheManager = createBackingEmbeddedCacheManager(); this.cacheManager = new SpringEmbeddedCacheManager(nativeEmbeddedCacheManager); logger.info("Successfully initialized SpringEmbeddedCacheManager instance [" + this.cacheManager + "]"); }
/** * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ @Override public void afterPropertiesSet() throws Exception { logger.info("Initializing SpringEmbeddedCacheManager instance ..."); final EmbeddedCacheManager nativeEmbeddedCacheManager = createBackingEmbeddedCacheManager(); this.cacheManager = new SpringEmbeddedCacheManager(nativeEmbeddedCacheManager); logger.info("Successfully initialized SpringEmbeddedCacheManager instance [" + this.cacheManager + "]"); }
/** * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ @Override public void afterPropertiesSet() throws Exception { if (this.infinispanRemoteCacheManager == null) { throw new IllegalStateException("No Infinispan RemoteCacheManager has been set"); } this.logger.info("Initializing named Infinispan remote cache ..."); final String effectiveCacheName = obtainEffectiveCacheName(); this.infinispanCache = this.infinispanRemoteCacheManager.getCache(effectiveCacheName); this.logger.info("New Infinispan remote cache [" + this.infinispanCache + "] initialized"); }
/** * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ @Override public void afterPropertiesSet() throws Exception { assertCorrectlyConfigured(); this.logger.info("Creating new instance of RemoteCacheManager ..."); final Properties configurationPropertiesToUse = configurationProperties(); this.nativeRemoteCacheManager = new RemoteCacheManager(configurationPropertiesToUse, this.startAutomatically); this.logger.info("Finished creating new instance of RemoteCacheManager"); }
private void log(String s) { System.out.println(s); log.info(s); } }
private void startStaleNodesLinkCleaner(long staleNodesLinksCleanerDelay) { Properties props = new Properties(); props.put("threadNamePrefix", "StaleNodesLinksCleaner"); ScheduledExecutorService executorService = new DefaultScheduledExecutorFactory().getScheduledExecutor(props); executorService.scheduleWithFixedDelay(new StaleNodesLinksCleaner(), staleNodesLinksCleanerDelay, staleNodesLinksCleanerDelay, TimeUnit.MILLISECONDS); log.info("StaleNodesCleaner started successfully with delay " + staleNodesLinksCleanerDelay); }
@Merged public void viewMerged(MergeEvent vce) { log.info("vce = " + vce); isMerged = true; } }
@CacheEntriesEvicted @SuppressWarnings("unused") public void entryEvicted(Event e) { log.info("Cache entries evicted, now check in different thread"); after.countDown(); // Force a bit of delay in the listener so that lack of visibility // of changes in container can be appreciated more easily TestingUtil.sleepThread(1000); } }
@CacheEntriesEvicted @SuppressWarnings("unused") public void entryEvicted(Event e) { log.info("Cache entry evicted, now check in different thread"); after.countDown(); // Force a bit of delay in the listener so that lack of visibility // of changes in container can be appreciated more easily TestingUtil.sleepThread(1000); }
/** * Simple test. Put some state, trigger event, test results */ @Test public void testNonTransactional() throws Throwable { List<MagicKey> keys = init(); log.info("Invoking rehash event"); performRehashEvent(false); waitForRehashCompletion(); log.info("Rehash complete"); for (MagicKey key : keys) assertOnAllCachesAndOwnership(key, "v0"); }
public void testNonSerializable() throws Exception { try { marshaller.objectToByteBuffer(new Object()); } catch (NotSerializableException e) { log.info("Log exception for output format verification", e); TraceInformation inf = (TraceInformation) e.getCause(); if (inf != null) { assert inf.toString().contains("in object java.lang.Object@"); } } }
public void testErrorUnmarshalling() throws Exception { Pojo pojo = new PojoWhichFailsOnUnmarshalling(); byte[] bytes = marshaller.objectToByteBuffer(pojo); try { marshaller.objectFromByteBuffer(bytes); } catch (IOException e) { log.info("Log exception for output format verification", e); TraceInformation inf = (TraceInformation) e.getCause(); if (inf != null) assert inf.toString().contains("in object of type org.infinispan.marshall.VersionAwareMarshallerTest$PojoWhichFailsOnUnmarshalling"); } }
protected void testRemoveServers() throws InterruptedException { log.info("** before calling stop"); caches.get(2).getCacheManager().stop(); caches.remove(2); waitForClusterToResize(); assertEquals(2, caches.size()); assertUnaffected(); }
@Test public void testNodeComesUpWithClusterListenerAlreadyInstalled() { Cache<Object, String> cache0 = cache(0, CACHE_NAME); ClusterListener clusterListener = listener(); cache0.addListener(clusterListener); log.info("Adding a new node .."); addClusterEnabledCacheManager(builderUsed); log.info("Added a new node"); Cache<Object, String> cache3 = cache(3, CACHE_NAME); MagicKey key = new MagicKey(cache3); verifySimpleInsertion(cache3, key, FIRST_VALUE, null, clusterListener, FIRST_VALUE); }
@Override public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable { // First execute the operation itself Object ret = super.visitPutKeyValueCommand(ctx, command); assertKeySet = (cache.keySet().size() == 1); // After entry has been committed to the container log.info("Cache entry created, now check in different thread"); latch.countDown(); // Force a bit of delay in the listener TestingUtil.sleepThread(3000); return ret; }
public void testNestedNonSerializable() throws Exception { PutKeyValueCommand cmd = new PutKeyValueCommand( "k", new Object(), false, null, new EmbeddedMetadata.Builder().build(), 0, EnumUtil.EMPTY_BIT_SET, CommandInvocationId.generateId(null)); try { marshaller.objectToByteBuffer(cmd); } catch (NotSerializableException e) { log.info("Log exception for output format verification", e); TraceInformation inf = (TraceInformation) e.getCause(); if (inf != null) { assert inf.toString().contains("in object java.lang.Object@"); } } }