Search in sources :

Example 1 with SessionCreationMetaData

use of org.wildfly.clustering.web.cache.session.SessionCreationMetaData in project wildfly by wildfly.

the class AbstractInfinispanSessionMetaDataFactory method createSessionMetaData.

@Override
public InvalidatableSessionMetaData createSessionMetaData(String id, CompositeSessionMetaDataEntry<L> entry) {
    boolean newSession = entry.getCreationMetaData().isNew();
    SessionCreationMetaDataKey creationMetaDataKey = new SessionCreationMetaDataKey(id);
    Mutator creationMutator = this.properties.isTransactional() && newSession ? Mutator.PASSIVE : this.creationMetaDataMutatorFactory.createMutator(creationMetaDataKey, new SessionCreationMetaDataEntry<>(entry.getCreationMetaData(), entry.getLocalContext()));
    SessionCreationMetaData creationMetaData = new MutableSessionCreationMetaData(entry.getCreationMetaData(), creationMutator);
    SessionAccessMetaDataKey accessMetaDataKey = new SessionAccessMetaDataKey(id);
    Mutator accessMutator = this.properties.isTransactional() && newSession ? Mutator.PASSIVE : this.accessMetaDataMutatorFactory.createMutator(accessMetaDataKey, entry.getAccessMetaData());
    SessionAccessMetaData accessMetaData = new MutableSessionAccessMetaData(entry.getAccessMetaData(), accessMutator);
    return new CompositeSessionMetaData(creationMetaData, accessMetaData);
}
Also used : CompositeSessionMetaData(org.wildfly.clustering.web.cache.session.CompositeSessionMetaData) Mutator(org.wildfly.clustering.ee.Mutator) MutableSessionCreationMetaData(org.wildfly.clustering.web.cache.session.MutableSessionCreationMetaData) SessionCreationMetaData(org.wildfly.clustering.web.cache.session.SessionCreationMetaData) SimpleSessionCreationMetaData(org.wildfly.clustering.web.cache.session.SimpleSessionCreationMetaData) MutableSessionAccessMetaData(org.wildfly.clustering.web.cache.session.MutableSessionAccessMetaData) MutableSessionAccessMetaData(org.wildfly.clustering.web.cache.session.MutableSessionAccessMetaData) SimpleSessionAccessMetaData(org.wildfly.clustering.web.cache.session.SimpleSessionAccessMetaData) SessionAccessMetaData(org.wildfly.clustering.web.cache.session.SessionAccessMetaData) MutableSessionCreationMetaData(org.wildfly.clustering.web.cache.session.MutableSessionCreationMetaData) SessionCreationMetaDataEntry(org.wildfly.clustering.web.cache.session.SessionCreationMetaDataEntry)

Example 2 with SessionCreationMetaData

use of org.wildfly.clustering.web.cache.session.SessionCreationMetaData in project wildfly by wildfly.

the class HotRodSessionMetaDataFactory method createSessionMetaData.

@Override
public InvalidatableSessionMetaData createSessionMetaData(String id, CompositeSessionMetaDataEntry<L> entry) {
    boolean newSession = entry.getCreationMetaData().isNew();
    SessionCreationMetaDataKey creationMetaDataKey = new SessionCreationMetaDataKey(id);
    Mutator creationMutator = this.properties.isTransactional() && newSession ? Mutator.PASSIVE : this.creationMetaDataMutatorFactory.createMutator(creationMetaDataKey, new SessionCreationMetaDataEntry<>(entry.getCreationMetaData(), entry.getLocalContext()));
    SessionCreationMetaData creationMetaData = new MutableSessionCreationMetaData(entry.getCreationMetaData(), creationMutator);
    SessionAccessMetaDataKey accessMetaDataKey = new SessionAccessMetaDataKey(id);
    Mutator accessMutator = this.properties.isTransactional() && newSession ? Mutator.PASSIVE : this.accessMetaDataMutatorFactory.createMutator(accessMetaDataKey, entry.getAccessMetaData());
    SessionAccessMetaData accessMetaData = new MutableSessionAccessMetaData(entry.getAccessMetaData(), accessMutator);
    return new CompositeSessionMetaData(creationMetaData, accessMetaData);
}
Also used : CompositeSessionMetaData(org.wildfly.clustering.web.cache.session.CompositeSessionMetaData) Mutator(org.wildfly.clustering.ee.Mutator) MutableSessionCreationMetaData(org.wildfly.clustering.web.cache.session.MutableSessionCreationMetaData) SessionCreationMetaData(org.wildfly.clustering.web.cache.session.SessionCreationMetaData) SimpleSessionCreationMetaData(org.wildfly.clustering.web.cache.session.SimpleSessionCreationMetaData) MutableSessionAccessMetaData(org.wildfly.clustering.web.cache.session.MutableSessionAccessMetaData) MutableSessionAccessMetaData(org.wildfly.clustering.web.cache.session.MutableSessionAccessMetaData) SimpleSessionAccessMetaData(org.wildfly.clustering.web.cache.session.SimpleSessionAccessMetaData) SessionAccessMetaData(org.wildfly.clustering.web.cache.session.SessionAccessMetaData) MutableSessionCreationMetaData(org.wildfly.clustering.web.cache.session.MutableSessionCreationMetaData) SessionCreationMetaDataEntry(org.wildfly.clustering.web.cache.session.SessionCreationMetaDataEntry)

Aggregations

Mutator (org.wildfly.clustering.ee.Mutator)2 CompositeSessionMetaData (org.wildfly.clustering.web.cache.session.CompositeSessionMetaData)2 MutableSessionAccessMetaData (org.wildfly.clustering.web.cache.session.MutableSessionAccessMetaData)2 MutableSessionCreationMetaData (org.wildfly.clustering.web.cache.session.MutableSessionCreationMetaData)2 SessionAccessMetaData (org.wildfly.clustering.web.cache.session.SessionAccessMetaData)2 SessionCreationMetaData (org.wildfly.clustering.web.cache.session.SessionCreationMetaData)2 SessionCreationMetaDataEntry (org.wildfly.clustering.web.cache.session.SessionCreationMetaDataEntry)2 SimpleSessionAccessMetaData (org.wildfly.clustering.web.cache.session.SimpleSessionAccessMetaData)2 SimpleSessionCreationMetaData (org.wildfly.clustering.web.cache.session.SimpleSessionCreationMetaData)2