Package org.jredis

Examples of org.jredis.ClientRuntimeException


    //
    try {
      initializeSocketStreams ();
    }
    catch (IOException e) {
      throw new ClientRuntimeException("Error obtaining connected socket's streams ", e);
    }
   
    isConnected = true;
   
    try {
View Full Code Here


          this.queueRequest(Command.SELECT, Convert.toBytes(spec.getDatabase())).get();
        }
        }
        catch (InterruptedException e) {
          e.printStackTrace();
          throw new ClientRuntimeException("Interrupted while initializing asynchronous connection", e);
        }
        catch (ExecutionException e) {
          e.printStackTrace();
          if(e.getCause() != null){
            if(e.getCause() instanceof RedisException)
View Full Code Here

    {
    if(!isConnected())
      throw new NotConnectedException ("Not connected!");
   
    if(pendingQuit)
      throw new ClientRuntimeException("Pipeline shutting down: Quit in progess; no further requests are accepted.");
   
    Protocol    protocol = Assert.notNull(getProtocolHandler(), "thread protocol handler", ProviderException.class);
    Request     request = Assert.notNull(protocol.createRequest (cmd, args), "request object from handler", ProviderException.class);
    PendingRequest   pendingResponse = new PendingRequest(cmd);
   
View Full Code Here

            onResponseHandlerError(cre, pending);
            break;
          }
          catch (RuntimeException e){
            Log.problem ("Unexpected (and not handled) RuntimeException: " + e.getMessage());
            onResponseHandlerError(new ClientRuntimeException("Unexpected (and not handled) RuntimeException", e), pending);
            break;
          }
         
          // redis (1.00) simply shutsdown connection even if pending responses
          // are expected, so quit is NOT sent.  we simply close connection on this
View Full Code Here

          // This will block.
          response = pendingResponse.get();
        }
        catch (InterruptedException e) {
          e.printStackTrace();
          throw new ClientRuntimeException("on pendingResponse.get()", e);
        }
        catch (ExecutionException e) {
          if(e.getCause() instanceof RedisException) {
            throw (RedisException) e.getCause();
          }
View Full Code Here

        buffer.writeTo(out);
        out.flush();
      }
      catch (SocketException e){
        Log.error("StreamBufferRequest.write(): SocketException on write: " + e.getLocalizedMessage());
        throw new ClientRuntimeException ("socket exception", e);
      }
      catch (IOException e) {
        Log.error("StreamBufferRequest.write(): IOException on write: " + e.getLocalizedMessage());
        throw new ClientRuntimeException ("stream io exception", e);
      }
    }
View Full Code Here

        Response response = null;
        try {
                  response = JRedisPipeline.this.queueRequest(cmd, args).get();
                }
                catch (InterruptedException e) {
                  throw new ClientRuntimeException("Interrupted!", e);
                }
                catch (ExecutionException e) {
                  Throwable cause = e.getCause();
                  if(cause instanceof RedisException)
                    throw (RedisException) cause;
                  else if(cause instanceof ProviderException)
                    throw (ProviderException) cause;
                  else if(cause instanceof ClientRuntimeException)
                    throw (ClientRuntimeException)cause;
                  else throw new ClientRuntimeException("Exception in pipeline exec of requested command", cause);
                }
                return response;
            }
    };
  }
View Full Code Here

        Response response = null;
        try {
                  response = JRedisPipeline.this.queueRequest(cmd, args).get(timeout, unit);
                }
                catch (InterruptedException e) {
                  throw new ClientRuntimeException("Interrupted!", e);
                }
                catch (TimeoutException e) {
                  throw new ClientRuntimeException("timedout waiting for response");
                }
                catch (ExecutionException e) {
                  Throwable cause = e.getCause();
                  if(cause instanceof RedisException)
                    throw (RedisException) cause;
                  else if(cause instanceof ProviderException)
                    throw (ProviderException) cause;
                  else if(cause instanceof ClientRuntimeException)
                    throw (ClientRuntimeException)cause;
                  else throw new ClientRuntimeException("Exception in pipeline exec of requested command", cause);
                }
                return response;
            }
    };
  }
View Full Code Here

      int readcnt = -1;
      int offset = 0;

      while(offset < length){
        if((readcnt = in.read (data, offset, length-offset)) ==-1 ) throw new ClientRuntimeException("IO - read returned -1 -- problem");
        offset += readcnt;
      }
      if((readcnt = in.read (term, 0, CRLF.length)) != CRLF.length) {
        throw new RuntimeException ("Only read " + readcnt + " bytes for CRLF!");
      }
View Full Code Here

TOP

Related Classes of org.jredis.ClientRuntimeException

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.