use of org.wildfly.clustering.ee.immutable.SimpleImmutability in project wildfly by wildfly.
the class UndertowSessionManagementProviderFactory method createSessionManagementProvider.
@Override
public SessionManagementProvider createSessionManagementProvider(DeploymentUnit unit, ReplicationConfig config) {
DistributableSessionManagementProvider provider = unit.getAttachment(DistributableSessionManagementProvider.ATTACHMENT_KEY);
// For compatibility, honor legacy <replication-config/> over an attached provider
if ((config != null) || (provider == null)) {
if (provider != null) {
UndertowClusteringLogger.ROOT_LOGGER.legacySessionManagementProviderOverride(unit.getName());
} else {
UndertowClusteringLogger.ROOT_LOGGER.legacySessionManagementProviderInUse(unit.getName());
}
// Fabricate DistributableSessionManagementProvider from legacy ReplicationConfig
provider = this.legacyFactory.createSessionManagerProvider(config);
}
Module module = unit.getAttachment(Attachments.MODULE);
List<String> immutableClasses = unit.getAttachmentList(DistributableSessionManagementProvider.IMMUTABILITY_ATTACHMENT_KEY);
return new UndertowDistributableSessionManagementProvider(provider, new SimpleImmutability(module.getClassLoader(), immutableClasses));
}
Aggregations