Class PutMapCommand

    • Method Detail

      • hasZeroLockAcquisition

        public boolean hasZeroLockAcquisition()
        Specified by:
        hasZeroLockAcquisition in interface RemoteLockCommand
        Returns:
        it the locks should be acquire with 0 (zero) acquisition timeout.
      • perform

        public Object perform​(InvocationContext ctx)
                       throws Throwable
        Description copied from interface: VisitableCommand
        Performs the primary function of the command. Please see specific implementation classes for details on what is performed as well as return types. Important: this method will be invoked at the end of interceptors chain. It should never be called directly from a custom interceptor.
        Specified by:
        perform in interface ReplicableCommand
        Specified by:
        perform in interface VisitableCommand
        Parameters:
        ctx - invocation context
        Returns:
        arbitrary return value generated by performing this command
        Throws:
        Throwable - in the event of problems.
      • getCommandId

        public byte getCommandId()
        Description copied from interface: ReplicableCommand
        Used by marshallers to convert this command into an id for streaming.
        Specified by:
        getCommandId in interface ReplicableCommand
        Returns:
        the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isSuccessful

        public boolean isSuccessful()
        Description copied from interface: WriteCommand
        Some commands may want to provide information on whether the command was successful or not. This is different from a failure, which usually would result in an exception being thrown. An example is a putIfAbsent() not doing anything because the key in question was present. This would result in a isSuccessful() call returning false.
        Specified by:
        isSuccessful in interface ReplicableCommand
        Specified by:
        isSuccessful in interface WriteCommand
        Returns:
        true if the command completed successfully, false otherwise.
      • isConditional

        public boolean isConditional()
        Description copied from interface: WriteCommand
        Certain commands only work based on a certain condition or state of the cache. For example, ConcurrentMap.putIfAbsent(Object, Object) only does anything if a condition is met, i.e., the entry in question is not already present. This method tests whether the command in question is conditional or not.
        Specified by:
        isConditional in interface WriteCommand
        Returns:
        true if the command is conditional, false otherwise
      • getAffectedKeys

        public Collection<?> getAffectedKeys()
        Specified by:
        getAffectedKeys in interface WriteCommand
        Returns:
        a collection of keys affected by this write command. Some commands - such as ClearCommand - may return an empty collection for this method.
      • isReturnValueExpected

        public boolean isReturnValueExpected()
        Description copied from interface: ReplicableCommand
        If true, a return value will be provided when performed remotely. Otherwise, a remote ResponseGenerator may choose to simply return null to save on marshalling costs.
        Specified by:
        isReturnValueExpected in interface ReplicableCommand
        Returns:
        true or false
      • canBlock

        public boolean canBlock()
        Description copied from interface: ReplicableCommand
        If true, the command is processed asynchronously in a thread provided by an Infinispan thread pool. Otherwise, the command is processed directly in the JGroups thread.

        This feature allows to avoid keep a JGroups thread busy that can originate discard of messages and retransmissions. So, the commands that can block (waiting for some state, acquiring locks, etc.) should return true.

        Specified by:
        canBlock in interface ReplicableCommand
        Returns:
        true if the command can block/wait, false otherwise
      • isForwarded

        public boolean isForwarded()
        For non transactional caches that support concurrent writes (default), the commands are forwarded between nodes, e.g.: - commands is executed on node A, but some of the keys should be locked on node B - the command is send to the main owner (B) - B tries to acquire lock on the keys it owns, then forwards the commands to the other owners as well - at this last stage, the command has the "isForwarded" flag set to true.
      • setForwarded

        public void setForwarded​(boolean forwarded)
        See Also:
        isForwarded()