Search in sources :

Example 1 with MBeanServerProvider

use of org.jboss.as.clustering.infinispan.MBeanServerProvider in project wildfly by wildfly.

the class GlobalConfigurationBuilder method getValue.

@Override
public GlobalConfiguration getValue() {
    org.infinispan.configuration.global.GlobalConfigurationBuilder builder = new org.infinispan.configuration.global.GlobalConfigurationBuilder();
    TransportConfiguration transport = this.transport.getValue();
    // This fails due to ISPN-4755 !!
    // this.builder.transport().read(this.transport.getValue());
    // Workaround this by copying relevant fields individually
    builder.transport().transport(transport.transport()).distributedSyncTimeout(transport.distributedSyncTimeout()).clusterName(transport.clusterName()).machineId(transport.machineId()).rackId(transport.rackId()).siteId(transport.siteId());
    Module module = this.module.getValue();
    builder.serialization().classResolver(ModularClassResolver.getInstance(this.loader.getValue()));
    builder.classLoader(module.getClassLoader());
    int id = Ids.MAX_ID;
    for (Externalizer<?> externalizer : module.loadService(Externalizer.class)) {
        InfinispanLogger.ROOT_LOGGER.debugf("Cache container %s will use an externalizer for %s", this.name, externalizer.getTargetClass().getName());
        builder.serialization().addAdvancedExternalizer(id++, new AdvancedExternalizerAdapter<>(externalizer));
    }
    builder.transport().transportThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.TRANSPORT).getValue());
    builder.transport().remoteCommandThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.REMOTE_COMMAND).getValue());
    builder.asyncThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.ASYNC_OPERATIONS).getValue());
    builder.expirationThreadPool().read(this.schedulers.get(ScheduledThreadPoolResourceDefinition.EXPIRATION).getValue());
    builder.listenerThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.LISTENER).getValue());
    builder.stateTransferThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.STATE_TRANSFER).getValue());
    builder.persistenceThreadPool().read(this.pools.get(ThreadPoolResourceDefinition.PERSISTENCE).getValue());
    builder.shutdown().hookBehavior(ShutdownHookBehavior.DONT_REGISTER);
    builder.globalJmxStatistics().enabled(this.statisticsEnabled).cacheManagerName(this.name).mBeanServerLookup(new MBeanServerProvider((this.server != null) ? this.server.getValue() : null)).jmxDomain("org.wildfly.clustering.infinispan").allowDuplicateDomains(true);
    builder.site().read(this.site.getValue());
    return builder.build();
}
Also used : TransportConfiguration(org.infinispan.configuration.global.TransportConfiguration) Module(org.jboss.modules.Module) MBeanServerProvider(org.jboss.as.clustering.infinispan.MBeanServerProvider)

Aggregations

TransportConfiguration (org.infinispan.configuration.global.TransportConfiguration)1 MBeanServerProvider (org.jboss.as.clustering.infinispan.MBeanServerProvider)1 Module (org.jboss.modules.Module)1