@Override public Void invoke(Cache<String, Map<Object, Object>> cache) { Map<Object, Object> map = cache.putIfAbsent(sessionId, null); SessionMapEntry.VERSION.put(map, Integer.valueOf(sessionData.getVersion())); SessionMapEntry.METADATA.put(map, sessionData.getMetadata()); SessionMapEntry.TIMESTAMP.put(map, sessionData.getTimestamp()); DistributedCacheManager.this.attributeStorage.store(map, sessionData); return null; } };
/** * {@inheritDoc} * @see org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager#storeSessionData(org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData) */ @Override public void storeSessionData(final T sessionData) { final String sessionId = sessionData.getRealId(); trace("storeSessionData(%s)", sessionId); Operation<Void> operation = new Operation<Void>() { @Override public Void invoke(Cache<String, Map<Object, Object>> cache) { Map<Object, Object> map = cache.putIfAbsent(sessionId, null); SessionMapEntry.VERSION.put(map, Integer.valueOf(sessionData.getVersion())); SessionMapEntry.METADATA.put(map, sessionData.getMetadata()); SessionMapEntry.TIMESTAMP.put(map, sessionData.getTimestamp()); DistributedCacheManager.this.attributeStorage.store(map, sessionData); return null; } }; this.batch(operation); }