Search in sources :

Example 1 with SimpleImmutability

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));
}
Also used : SimpleImmutability(org.wildfly.clustering.ee.immutable.SimpleImmutability) DistributableSessionManagementProvider(org.wildfly.clustering.web.session.DistributableSessionManagementProvider) Module(org.jboss.modules.Module)

Aggregations

Module (org.jboss.modules.Module)1 SimpleImmutability (org.wildfly.clustering.ee.immutable.SimpleImmutability)1 DistributableSessionManagementProvider (org.wildfly.clustering.web.session.DistributableSessionManagementProvider)1