Package net.spy.memcached.ops

Examples of net.spy.memcached.ops.OperationException


  protected void handleError(OperationErrorType eType, String line)
    throws IOException {
    getLogger().error("Error:  %s", line);
    switch(eType) {
      case GENERAL:
        exception=new OperationException();
        break;
      case SERVER:
        exception=new OperationException(eType, line);
        break;
      case CLIENT:
        exception=new OperationException(eType, line);
        break;
      default: assert false;
    }
    transitionState(OperationState.COMPLETE);
    throw exception;
View Full Code Here


  protected void handleError(OperationErrorType eType, String line)
    throws IOException {
    getLogger().error("Error:  %s", line);
    switch(eType) {
      case GENERAL:
        exception=new OperationException();
        break;
      case SERVER:
        exception=new OperationException(eType, line);
        break;
      case CLIENT:
        exception=new OperationException(eType, line);
        break;
      default: assert false;
    }
    transitionState(OperationState.COMPLETE);
    throw exception;
View Full Code Here

      } else {
        callback.receivedStatus(new OperationStatus(false,
            Integer.toString(errorcode)));
      }
    } catch (ParseException e) {
      exception = new OperationException(OperationErrorType.GENERAL,
        "Error parsing JSON");
    }
    callback.complete();
  }
View Full Code Here

      } else {
        callback.receivedStatus(new OperationStatus(false,
            Integer.toString(errorcode)));
      }
    } catch (ParseException e) {
      exception = new OperationException(OperationErrorType.GENERAL,
        "Error parsing JSON");
    }
    callback.complete();
  }
View Full Code Here

  protected String getEntityString(HttpResponse response) {
    if (!isTimedOut() && !hasErrored() && !isCancelled()) {
      try {
        return EntityUtils.toString(response.getEntity());
      } catch (org.apache.http.ParseException e) {
        exception = new OperationException(OperationErrorType.GENERAL,
          "Bad http headers");
        errored = true;
      } catch (IOException e) {
        exception = new OperationException(OperationErrorType.GENERAL,
          "Error reading response");
        errored = true;
      } catch (IllegalArgumentException e) {
        exception = new OperationException(OperationErrorType.GENERAL,
          "No entity");
        errored = true;
      }
    }
    return null;
View Full Code Here

    int errorcode = response.getStatusLine().getStatusCode();
    try {
      OperationStatus status = parseViewForStatus(json, errorcode);
      callback.receivedStatus(status);
    } catch (ParseException e) {
      setException(new OperationException(OperationErrorType.GENERAL,
          "Error parsing JSON" + e));
    }
    callback.complete();
  }
View Full Code Here

      } else {
        callback.receivedStatus(new OperationStatus(false,
            Integer.toString(errorcode)));
      }
    } catch (ParseException e) {
      exception = new OperationException(OperationErrorType.GENERAL,
        "Error parsing JSON");
    }
    callback.complete();
  }
View Full Code Here

      }

      ((ViewCallback) callback).gotData(vr);
      callback.receivedStatus(status);
    } catch (ParseException e) {
      setException(new OperationException(OperationErrorType.GENERAL,
          "Error parsing JSON"));
    }
    callback.complete();
  }
View Full Code Here

      throw new RuntimeException("Interrupted waiting for config", e);
    } catch(OperationNotSupportedException e){
      throw e;
    } catch (ExecutionException e) {
      if(e.getCause() instanceof OperationException){
        OperationException exp = (OperationException)e.getCause();
        if(OperationErrorType.GENERAL.equals(exp.getType())){
          throw new OperationNotSupportedException("This version of getConfig command is not supported.");
        }
      }
      throw new RuntimeException("Exception waiting for config", e);
    } catch (TimeoutException e) {
View Full Code Here

  protected void handleError(OperationErrorType eType, String line)
    throws IOException {
    getLogger().error("Error:  %s", line);
    switch (eType) {
    case GENERAL:
      exception = new OperationException();
      break;
    case SERVER:
      exception = new OperationException(eType, line);
      break;
    case CLIENT:
      exception = new OperationException(eType, line);
      break;
    default:
      assert false;
    }
    callback.receivedStatus(new OperationStatus(false,
View Full Code Here

TOP

Related Classes of net.spy.memcached.ops.OperationException

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.