/** * Returns the name of this cache container. * @return the cache container name */ default String getName() { return this.getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName(); }
@Override public int hashCode() { return this.cache.getCacheManager().getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName().hashCode() ^ this.cache.getName().hashCode(); }
@Override public boolean equals(Object object) { if ((object == null) || !(object instanceof InfinispanXAResourceRecovery)) return false; InfinispanXAResourceRecovery recovery = (InfinispanXAResourceRecovery) object; return this.cache.getCacheManager().getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName().equals(recovery.cache.getCacheManager().getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName()) && this.cache.getName().equals(recovery.cache.getName()); }
@Override protected void initChannel() { try { this.channel = this.factory.createChannel(this.configuration.globalJmxStatistics().cacheManagerName()); this.channel.setDiscardOwnMessages(false); } catch (Exception e) { throw new CacheException(e); } } }
@Override public String toString() { return this.cache.getCacheManager().getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName() + "." + this.cache.getName(); } }
ClusteringServerLogger.ROOT_LOGGER.registryListenerFailed(e, this.cache.getCacheManager().getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName(), this.cache.getName(), type, entries);
@CacheEntryCreated @CacheEntryModified public void modified(CacheEntryEvent<T, Set<Address>> event) { if (event.isPre()) return; Map.Entry<Listener, ExecutorService> entry = this.listeners.get(event.getKey()); if (entry != null) { Listener listener = entry.getKey(); if (listener != null) { ExecutorService executor = entry.getValue(); Set<Node> members = new TreeSet<>(); for (Address address : event.getValue()) { members.add(this.group.createNode(address)); } try { executor.submit(() -> { try { listener.providersChanged(members); } catch (Throwable e) { ClusteringServerLogger.ROOT_LOGGER.serviceProviderRegistrationListenerFailed(e, this.cache.getCacheManager().getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName(), this.cache.getName(), members); } }); } catch (RejectedExecutionException e) { // Executor was shutdown } } } } }
@Override public String getName() { GlobalConfiguration global = this.cache.getCacheManager().getCacheManagerConfiguration(); TransportConfiguration transport = global.transport(); return transport.transport() != null ? transport.clusterName() : global.globalJmxStatistics().cacheManagerName(); }
@Override public void start() { GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder(); // WFLY-6685 Prevent Infinispan from registering channel mbeans // The JGroups subsystem already does this builder.globalJmxStatistics().read(this.configuration.globalJmxStatistics()).disable(); // ISPN-4755 workaround TransportConfiguration transport = this.configuration.transport(); builder.transport() .clusterName(transport.clusterName()) .distributedSyncTimeout(transport.distributedSyncTimeout()) .initialClusterSize(transport.initialClusterSize()) .initialClusterTimeout(transport.initialClusterTimeout(), TimeUnit.MILLISECONDS) .machineId(transport.machineId()) .nodeName(transport.nodeName()) .rackId(transport.rackId()) .siteId(transport.siteId()) .transport(transport.transport()) .withProperties(transport.properties()) ; this.configuration = builder.build(); super.start(); }
@Override public boolean equals(Object object) { if ((object == null) || !(object instanceof InfinispanXAResourceRecovery)) return false; InfinispanXAResourceRecovery recovery = (InfinispanXAResourceRecovery) object; return this.container.getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName().equals(recovery.container.getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName()) && this.cacheName.equals(recovery.cacheName); }
@Override public String toString() { return container.getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName() + "." + this.cacheName; } }
/** * {@inheritDoc} * @see java.lang.Object#toString() */ @Override public String toString() { return this.cm.getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName(); }
@Override protected void initChannel() { try { this.channel = this.factory.createChannel(this.configuration.globalJmxStatistics().cacheManagerName()); this.channel.setDiscardOwnMessages(false); } catch (Exception e) { throw new CacheException(e); } } }
@Override public String getName() { GlobalConfiguration global = this.cache.getCacheManager().getCacheManagerConfiguration(); TransportConfiguration transport = global.transport(); return transport.transport() != null ? transport.clusterName() : global.globalJmxStatistics().cacheManagerName(); }
private ObjectName getQueryStatsObjectName(String jmxDomain, String cacheName) { String cacheManagerName = cacheManager.getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName(); try { return new ObjectName(jmxDomain + ":type=Query,manager=" + ObjectName.quote(cacheManagerName) + ",cache=" + ObjectName.quote(cacheName) + ",component=Statistics"); } catch (MalformedObjectNameException e) { throw new CacheException("Malformed object name", e); } } }
@Override protected void rebuildIndexes() throws Exception { String cacheManagerName = manager(0).getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName(); ObjectName massIndexerObjName = getMassIndexerObjectName( BASE_JMX_DOMAIN + 0, cacheManagerName, manager(0).getCacheManagerConfiguration().defaultCacheName().get()); server.invoke(massIndexerObjName, "start", new Object[0], new String[0]); }
public void testRecoveryManagerInJmx() throws Exception { assert cache.getCacheConfiguration().transaction().transactionMode().isTransactional(); String jmxDomain = cacheManager.getCacheManagerConfiguration().globalJmxStatistics().domain(); assert !existsObject(getCacheObjectName(jmxDomain, cache.getName(), "RecoveryManager")); }
public void testNoRecoveryManager() throws Exception { assert cache.getCacheConfiguration().transaction().transactionMode().isTransactional(); String jmxDomain = cacheManager.getCacheManagerConfiguration().globalJmxStatistics().domain(); assert !existsObject(getCacheObjectName(jmxDomain, cache.getName(), "RecoveryManager")); }
public void testDifferentDomain() throws Exception { GlobalConfigurationBuilder globalConfiguration = GlobalConfigurationBuilder.defaultClusteredBuilder(); globalConfiguration.globalJmxStatistics().enable().mBeanServerLookup(new PerThreadMBeanServerLookup()); cm = TestCacheManagerFactory.createClusteredCacheManager(globalConfiguration, new ConfigurationBuilder()); String jmxDomain = cm.getCacheManagerConfiguration().globalJmxStatistics().domain(); ConfigurationBuilder localCache = config();//local by default cm.defineConfiguration("local_cache", localCache.build()); cm.getCache("local_cache"); assert existsObject(getCacheObjectName(jmxDomain, "local_cache(local)", "Statistics")); }
public void testMultipleManagersOnSameServerWithCloneFails() throws Exception { GlobalConfigurationBuilder globalConfiguration = GlobalConfigurationBuilder.defaultClusteredBuilder(); globalConfiguration.globalJmxStatistics().enable().mBeanServerLookup(new PerThreadMBeanServerLookup()); cm = TestCacheManagerFactory.createClusteredCacheManager(globalConfiguration, new ConfigurationBuilder()); String jmxDomain = cm.getCacheManagerConfiguration().globalJmxStatistics().domain(); ConfigurationBuilder localCache = config();//local by default localCache.jmxStatistics().enable(); cm.defineConfiguration("local_cache", localCache.build()); cm.getCache("local_cache"); assert existsObject(getCacheObjectName(jmxDomain, "local_cache(local)", "Statistics")); expectException(EmbeddedCacheManagerStartupException.class, JmxDomainConflictException.class, () -> TestCacheManagerFactory.createClusteredCacheManagerEnforceJmxDomain(jmxDomain, false)); }