Package org.infinispan.commands.write

Examples of org.infinispan.commands.write.AbstractDataWriteCommand


   }

   @Override
   protected void checkIfKeyRead(InvocationContext context, Object key, VisitableCommand command) {
      if (command instanceof AbstractDataWriteCommand) {
         AbstractDataWriteCommand writeCommand = (AbstractDataWriteCommand) command;
         //keep track is only need in a clustered and transactional environment to perform the write skew check
         if (context.isInTxScope() && context.isOriginLocal()) {
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
            if (!writeCommand.hasFlag(Flag.PUT_FOR_STATE_TRANSFER) && writeCommand.isConditional() ||
                  !writeCommand.hasFlag(Flag.IGNORE_RETURN_VALUES)) {
               //State transfer does not show the old value for the application neither with the IGNORE_RETURN_VALUES.
               //on other hand, the conditional always read key!
               txInvocationContext.getCacheTransaction().addReadKey(key);
            }
            writeCommand.setPreviousRead(txInvocationContext.getCacheTransaction().keyRead(key));
         }
      } else if (command instanceof GetKeyValueCommand) {
         if (context.isInTxScope() && context.isOriginLocal()) {
            //always show the value to the application
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
View Full Code Here


   }

   @Override
   protected void checkIfKeyRead(InvocationContext context, Object key, VisitableCommand command) {
      if (command instanceof AbstractDataWriteCommand) {
         AbstractDataWriteCommand writeCommand = (AbstractDataWriteCommand) command;
         //keep track is only need in a clustered and transactional environment to perform the write skew check
         if (context.isInTxScope() && context.isOriginLocal()) {
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
            if (!writeCommand.hasFlag(Flag.PUT_FOR_STATE_TRANSFER) && writeCommand.isConditional() ||
                  !writeCommand.hasFlag(Flag.IGNORE_RETURN_VALUES)) {
               //State transfer does not show the old value for the application neither with the IGNORE_RETURN_VALUES.
               //on other hand, the conditional always read key!
               txInvocationContext.getCacheTransaction().addReadKey(key);
            }
            writeCommand.setPreviousRead(txInvocationContext.getCacheTransaction().keyRead(key));
         }
      } else if (command instanceof GetKeyValueCommand) {
         if (context.isInTxScope() && context.isOriginLocal()) {
            //always show the value to the application
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
View Full Code Here

   }

   @Override
   protected void checkIfKeyRead(InvocationContext context, Object key, VisitableCommand command) {
      if (command instanceof AbstractDataWriteCommand) {
         AbstractDataWriteCommand writeCommand = (AbstractDataWriteCommand) command;
         //keep track is only need in a clustered and transactional environment to perform the write skew check
         if (context.isInTxScope() && context.isOriginLocal()) {
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
            if (!writeCommand.hasFlag(Flag.PUT_FOR_STATE_TRANSFER) && writeCommand.isConditional() ||
                  !writeCommand.hasFlag(Flag.IGNORE_RETURN_VALUES)) {
               //State transfer does not show the old value for the application neither with the IGNORE_RETURN_VALUES.
               //on other hand, the conditional always read key!
               txInvocationContext.getCacheTransaction().addReadKey(key);
            }
            writeCommand.setPreviousRead(txInvocationContext.getCacheTransaction().keyRead(key));
         }
      } else if (command instanceof GetKeyValueCommand) {
         if (context.isInTxScope() && context.isOriginLocal()) {
            //always show the value to the application
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
View Full Code Here

   }

   @Override
   protected void checkIfKeyRead(InvocationContext context, Object key, VisitableCommand command) {
      if (command instanceof AbstractDataWriteCommand) {
         AbstractDataWriteCommand writeCommand = (AbstractDataWriteCommand) command;
         //keep track is only need in a clustered and transactional environment to perform the write skew check
         if (context.isInTxScope() && context.isOriginLocal()) {
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
            if (!writeCommand.hasFlag(Flag.PUT_FOR_STATE_TRANSFER) && writeCommand.isConditional() ||
                  !writeCommand.hasFlag(Flag.IGNORE_RETURN_VALUES)) {
               //State transfer does not show the old value for the application neither with the IGNORE_RETURN_VALUES.
               //on other hand, the conditional always read key!
               txInvocationContext.getCacheTransaction().addReadKey(key);
            }
            writeCommand.setPreviousRead(txInvocationContext.getCacheTransaction().keyRead(key));
         }
      } else if (command instanceof GetKeyValueCommand) {
         if (context.isInTxScope() && context.isOriginLocal()) {
            //always show the value to the application
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
View Full Code Here

   }

   @Override
   protected void checkIfKeyRead(InvocationContext context, Object key, VisitableCommand command) {
      if (command instanceof AbstractDataWriteCommand) {
         AbstractDataWriteCommand writeCommand = (AbstractDataWriteCommand) command;
         //keep track is only need in a clustered and transactional environment to perform the write skew check
         if (context.isInTxScope() && context.isOriginLocal()) {
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
            if (!writeCommand.hasFlag(Flag.PUT_FOR_STATE_TRANSFER) && writeCommand.isConditional() ||
                  !writeCommand.hasFlag(Flag.IGNORE_RETURN_VALUES)) {
               //State transfer does not show the old value for the application neither with the IGNORE_RETURN_VALUES.
               //on other hand, the conditional always read key!
               txInvocationContext.getCacheTransaction().addReadKey(key);
            }
            writeCommand.setPreviousRead(txInvocationContext.getCacheTransaction().keyRead(key));
         }
      } else if (command instanceof GetKeyValueCommand) {
         if (context.isInTxScope() && context.isOriginLocal()) {
            //always show the value to the application
            TxInvocationContext txInvocationContext = (TxInvocationContext) context;
View Full Code Here

TOP

Related Classes of org.infinispan.commands.write.AbstractDataWriteCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.