com.hazelcast.web
Class AddSessionEntryProcessor

java.lang.Object
  extended by com.hazelcast.map.AbstractEntryProcessor<String,T>
      extended by com.hazelcast.web.AbstractWebDataEntryProcessor<Integer>
          extended by com.hazelcast.web.AddSessionEntryProcessor
All Implemented Interfaces:
EntryProcessor<String,Integer>, DataSerializable, IdentifiedDataSerializable, Serializable

public class AddSessionEntryProcessor
extends AbstractWebDataEntryProcessor<Integer>

Sets the initial reference count to 1. If the entry already exists with a non-null value, this processor does nothing.

This EntryProcessor is only intended to be used when the first node in the cluster creates a given session. After that, when a new node in the cluster creates a local "copy" of the clustered session, ReferenceSessionEntryProcessor should be used to increment the reference count.

Since:
3.3
See Also:
Serialized Form

Constructor Summary
AddSessionEntryProcessor()
           
 
Method Summary
 int getId()
          Returns type identifier for this class.
 Object process(Map.Entry<String,Integer> entry)
          Process the entry without worrying about concurrency.
 
Methods inherited from class com.hazelcast.web.AbstractWebDataEntryProcessor
getFactoryId, readData, writeData
 
Methods inherited from class com.hazelcast.map.AbstractEntryProcessor
getBackupProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddSessionEntryProcessor

public AddSessionEntryProcessor()
Method Detail

getId

public int getId()
Description copied from interface: IdentifiedDataSerializable
Returns type identifier for this class. Id should be unique per DataSerializableFactory.

Returns:
type id

process

public Object process(Map.Entry<String,Integer> entry)
Description copied from interface: EntryProcessor
Process the entry without worrying about concurrency.

Note that to modify an entry by using EntryProcessor you should explicitly call Map.Entry.setValue(V) method of Map.Entry such as:

 
 Override
        public Object process(Map.Entry entry) {
          Value value = entry.getValue();
          // process and modify value
          // ...
          entry.setValue(value);
          return result;
        }
 
 
otherwise EntryProcessor does not guarantee to modify the entry.

Parameters:
entry - entry to be processed
Returns:
result of the process


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.