Package net.rubyeye.xmemcached.exception

Examples of net.rubyeye.xmemcached.exception.MemcachedException


  }

  private final Session sendCommand(final Command cmd)
      throws MemcachedException {
    if (this.shutdown) {
      throw new MemcachedException("Xmemcached is stopped");
    }
    return this.connector.send(cmd);
  }
View Full Code Here


    byte[] keyBytes = this.checkStoreArguments(key, exp, value);
    try {
      this.sendStoreCommand(this.commandFactory.createSetCommand(key,
          keyBytes, exp, value, true, transcoder), this.opTimeout);
    } catch (TimeoutException e) {
      throw new MemcachedException(e);
    }
  }
View Full Code Here

    byte[] keyBytes = this.checkStoreArguments(key, exp, value);
    try {
      this.sendStoreCommand(this.commandFactory.createAddCommand(key,
          keyBytes, exp, value, true, transcoder), this.opTimeout);
    } catch (TimeoutException e) {
      throw new MemcachedException(e);
    }

  }
View Full Code Here

    byte[] keyBytes = this.checkStoreArguments(key, exp, value);
    try {
      this.sendStoreCommand(this.commandFactory.createReplaceCommand(key,
          keyBytes, exp, value, true, transcoder), this.opTimeout);
    } catch (TimeoutException e) {
      throw new MemcachedException(e);
    }

  }
View Full Code Here

    byte[] keyBytes = this.checkStoreArguments(key, 0, value);
    try {
      this.sendStoreCommand(this.commandFactory.createAppendCommand(key,
          keyBytes, value, true, this.transcoder), this.opTimeout);
    } catch (TimeoutException e) {
      throw new MemcachedException(e);
    }

  }
View Full Code Here

    byte[] keyBytes = this.checkStoreArguments(key, 0, value);
    try {
      this.sendStoreCommand(this.commandFactory.createPrependCommand(key,
          keyBytes, value, true, this.transcoder), this.opTimeout);
    } catch (TimeoutException e) {
      throw new MemcachedException(e);
    }
  }
View Full Code Here

          "max tries must be greater than 0");
    }
    int tryCount = 0;
    GetsResponse<T> result = getsResponse;
    if (result == null) {
      throw new MemcachedException("Null GetsResponse");
    }
    while (tryCount <= operation.getMaxTries()
        && result != null
        && !this.sendStoreCommand(this.commandFactory.createCASCommand(
            key,
            keyBytes,
            exp,
            operation.getNewValue(result.getCas(),
                result.getValue()), result.getCas(), noreply,
            transcoder), this.opTimeout) && !noreply) {
      tryCount++;
      result = this.gets0(key, keyBytes, transcoder);
      if (result == null) {
        throw new MemcachedException(
            "could not gets the value for Key=" + key + " for cas");
      }
      if (tryCount > operation.getMaxTries()) {
        throw new TimeoutException("CAS try times is greater than max");
      }
View Full Code Here

  public final void deleteWithNoReply(final String key, final int time)
      throws InterruptedException, MemcachedException {
    try {
      this.delete0(key, time, 0, true, this.opTimeout);
    } catch (TimeoutException e) {
      throw new MemcachedException(e);
    }
  }
View Full Code Here

    if (!command.isNoreply()) {
      this.latchWait(command, opTimeout, session);
      command.getIoBuffer().free();
      this.checkException(command);
      if (command.getResult() == null) {
        throw new MemcachedException(
            "Operation fail,may be caused by networking or timeout");
      }
    } else {
      return false;
    }
View Full Code Here

  void checkException(final Command command) throws MemcachedException {
    if (command.getException() != null) {
      if (command.getException() instanceof MemcachedException) {
        throw (MemcachedException) command.getException();
      } else {
        throw new MemcachedException(command.getException());
      }
    }
  }
View Full Code Here

TOP

Related Classes of net.rubyeye.xmemcached.exception.MemcachedException

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.