@CacheStopped public void cacheStopped(CacheStoppedEvent event) { InfinispanLogger.ROOT_LOGGER.cacheStopped(event.getCacheName(), this.name); } }
@CacheStarted public void cacheStarted(CacheStartedEvent event) { InfinispanLogger.ROOT_LOGGER.cacheStarted(event.getCacheName(), this.name); }
@Merged @ViewChanged public void viewChanged(ViewChangedEvent event) { if (this.cache.getAdvancedCache().getDistributionManager() != null) { // Record view status for use by @TopologyChanged event this.views.put(event.getViewId(), event.isMergeView()); } else if (!this.listeners.isEmpty()) { Membership previousMembership = new CacheMembership(event.getLocalAddress(), event.getOldMembers(), this); Membership membership = new CacheMembership(event.getLocalAddress(), event.getNewMembers(), this); for (Map.Entry<GroupListener, ExecutorService> entry : this.listeners.entrySet()) { GroupListener listener = entry.getKey(); ExecutorService executor = entry.getValue(); try { executor.submit(() -> { try { listener.membershipChanged(previousMembership, membership, event.isMergeView()); } catch (Throwable e) { ClusteringServerLogger.ROOT_LOGGER.warn(e.getLocalizedMessage(), e); } }); } catch (RejectedExecutionException e) { // Listener was unregistered } } } }
public void testNotifyViewChanged() { Address a = mock(Address.class); List<Address> addresses = Collections.emptyList(); n.notifyViewChange(addresses, addresses, a, 100); assert cl.invocationCount == 1; assert ((ViewChangedEvent) cl.getEvent()).getLocalAddress() == a; assert ((ViewChangedEvent) cl.getEvent()).getNewMembers() == addresses; assert ((ViewChangedEvent) cl.getEvent()).getViewId() == 100; assert cl.getEvent().getType() == Event.Type.VIEW_CHANGED; }
@ViewChanged @Merged public void viewChangeEvent(ViewChangedEvent e) { updateClusterTable(e.getNewMembers()); }
@CacheStarted public void cacheStarted(CacheStartedEvent event) { log("Started", event.getCacheName(), event.getCacheManager()); }
public void testNotifyCacheStopped() { n.notifyCacheStopped("cache"); assert cl.invocationCount == 1; assert ((CacheStoppedEvent) cl.getEvent()).getCacheName().equals("cache"); assert cl.getEvent().getType() == Event.Type.CACHE_STOPPED; } }
public void testNotifyCacheStarted() { n.notifyCacheStarted("cache"); assert cl.invocationCount == 1; assert ((CacheStartedEvent) cl.getEvent()).getCacheName().equals("cache"); assert cl.getEvent().getType() == Event.Type.CACHE_STARTED; }
@CacheStopped public void cacheStopped(CacheStoppedEvent event) { if (log.isTraceEnabled()) { log.trace("Cache Started " + event.getCacheName()); } } }
private synchronized void applyViewChangedEvent(ViewChangedEvent e) { List<Address> newMembers = e.getNewMembers(); if (log.isDebugEnabled()) { log.debug("Notified of new View! Members: " + newMembers); } handleTopologyChange(newMembers); }
@CacheStarted public void cacheStarted(CacheStartedEvent event) { if (log.isTraceEnabled()) { log.trace("Cache Started " + event.getCacheName()); } }
@Override @CacheStopped public void fire(CacheStoppedEvent payload) { if (payload.getCacheName().equals(cacheName)) { super.fire(payload); } } }
private synchronized void applyViewChangedEvent(ViewChangedEvent e) { List<Address> newMembers = e.getNewMembers(); if (log.isDebugEnabled()) { log.debug("Notified of new View! Members: " + newMembers); } handleTopologyChange(newMembers); }
@Override @CacheStarted public void fire(CacheStartedEvent payload) { if (payload.getCacheName().equals(cacheName)) { super.fire(payload); } } }
@CacheStopped public void cacheStopped(CacheStoppedEvent event) { InfinispanLogger.ROOT_LOGGER.cacheStopped(event.getCacheName(), this.name); } }
@CacheStarted public void cacheStarted(CacheStartedEvent event) { InfinispanLogger.ROOT_LOGGER.cacheStarted(event.getCacheName(), this.name); }
@CacheStopped public void cacheStopped(CacheStoppedEvent event) { server.cacheStopped(event.getCacheName()); }
public ObserverAssertion hasProperName(String cacheName) { assertEquals(getNonEmptyListOfEvents(CacheStartedEvent.class).get(0).getCacheName(), cacheName); return this; }
@CacheStopped public void cacheStopped(CacheStoppedEvent cse) { stopOrder.add(cse.getCacheName()); } }
@CacheStopped public void cacheStopped(CacheStoppedEvent event) { log.tracef("Cache stopped: %s", event.getCacheName()); } }