Search in sources :

Example 6 with SessionCreationMetaDataEntry

use of org.wildfly.clustering.web.cache.session.SessionCreationMetaDataEntry 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)

Example 7 with SessionCreationMetaDataEntry

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

the class HotRodSessionMetaDataFactory method createValue.

@Override
public CompositeSessionMetaDataEntry<L> createValue(String id, Void context) {
    SessionCreationMetaDataEntry<L> creationMetaDataEntry = new SessionCreationMetaDataEntry<>(new SimpleSessionCreationMetaData());
    SessionAccessMetaData accessMetaData = new SimpleSessionAccessMetaData();
    this.creationMetaDataMutatorFactory.createMutator(new SessionCreationMetaDataKey(id), creationMetaDataEntry).mutate();
    this.accessMetaDataMutatorFactory.createMutator(new SessionAccessMetaDataKey(id), accessMetaData).mutate();
    return new CompositeSessionMetaDataEntry<>(creationMetaDataEntry, accessMetaData);
}
Also used : SimpleSessionAccessMetaData(org.wildfly.clustering.web.cache.session.SimpleSessionAccessMetaData) SimpleSessionCreationMetaData(org.wildfly.clustering.web.cache.session.SimpleSessionCreationMetaData) MutableSessionAccessMetaData(org.wildfly.clustering.web.cache.session.MutableSessionAccessMetaData) SimpleSessionAccessMetaData(org.wildfly.clustering.web.cache.session.SimpleSessionAccessMetaData) SessionAccessMetaData(org.wildfly.clustering.web.cache.session.SessionAccessMetaData) CompositeSessionMetaDataEntry(org.wildfly.clustering.web.cache.session.CompositeSessionMetaDataEntry) SessionCreationMetaDataEntry(org.wildfly.clustering.web.cache.session.SessionCreationMetaDataEntry)

Aggregations

SessionAccessMetaData (org.wildfly.clustering.web.cache.session.SessionAccessMetaData)7 SessionCreationMetaDataEntry (org.wildfly.clustering.web.cache.session.SessionCreationMetaDataEntry)7 CompositeSessionMetaDataEntry (org.wildfly.clustering.web.cache.session.CompositeSessionMetaDataEntry)5 MutableSessionAccessMetaData (org.wildfly.clustering.web.cache.session.MutableSessionAccessMetaData)5 SimpleSessionAccessMetaData (org.wildfly.clustering.web.cache.session.SimpleSessionAccessMetaData)5 SimpleSessionCreationMetaData (org.wildfly.clustering.web.cache.session.SimpleSessionCreationMetaData)5 Key (org.wildfly.clustering.ee.Key)3 HashSet (java.util.HashSet)2 Mutator (org.wildfly.clustering.ee.Mutator)2 CompositeSessionMetaData (org.wildfly.clustering.web.cache.session.CompositeSessionMetaData)2 MutableSessionCreationMetaData (org.wildfly.clustering.web.cache.session.MutableSessionCreationMetaData)2 SessionCreationMetaData (org.wildfly.clustering.web.cache.session.SessionCreationMetaData)2 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 HashMap (java.util.HashMap)1 ClientCacheEntryExpired (org.infinispan.client.hotrod.annotation.ClientCacheEntryExpired)1 Marshaller (org.infinispan.commons.marshall.Marshaller)1 ImmutableSession (org.wildfly.clustering.web.session.ImmutableSession)1 ImmutableSessionAttributes (org.wildfly.clustering.web.session.ImmutableSessionAttributes)1 ImmutableSessionMetaData (org.wildfly.clustering.web.session.ImmutableSessionMetaData)1