Package org.jredis

Examples of org.jredis.ClientRuntimeException


        }
        catch (IllegalArgumentException bug){
          throw new ProviderException ("Bug: in converting the bulk data length bytes", bug);
        }
        catch (IOException problem) {
          throw new ClientRuntimeException ("Problem: reading the bulk data bytes", problem);
        }
        catch (RuntimeException bug) {
          throw new ProviderException ("Bug: reading the multibulk data bytes.", bug);
        }
      }
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);
    //    Log.log("protocol %d@%s", protocol.hashCode(), protocol.getClass());

    final boolean sendreq =
View Full Code Here

//      if(connectImmediately) {
//        connect ();
//      }
    }
    catch (IllegalArgumentException e) {
      throw new ClientRuntimeException
        ("invalid connection spec parameters: " + e.getLocalizedMessage(), e);
    }
    catch (Exception e) {
      throw new ProviderException("Unexpected error on initialize -- BUG", e);
    }
View Full Code Here

      }
      catch (RuntimeException e){
        Log.error("while attempting reconnect: " + e.getMessage());
        if(++attempts == spec.getReconnectCnt()) {
          Log.problem("Retry limit exceeded attempting reconnect.");
          throw new ClientRuntimeException ("Failed to reconnect to the server.");
        }
      }
    }
  }
View Full Code Here

    //
    try {
      newSocketConnect();
    }
    catch (IOException e) {
      throw new ClientRuntimeException(
        "Socket connect failed -- make sure the server is running at " + spec.getAddress().getHostName(), e);
    }
   
    // get the streams
    //
    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

        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

      throw new NotConnectedException ("Not connected!");
   
    PendingRequest pendingResponse = null;
    synchronized (serviceLock) {
      if(pendingQuit)
        throw new ClientRuntimeException("Pipeline shutting down: Quit in progess; no further requests are accepted.");
     
      Request request = Assert.notNull(protocol.createRequest (cmd, args), "request object from handler", ProviderException.class);
     
      if(cmd != Command.QUIT)
        request.write(getOutputStream());
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;
            }

            // REVU: this should be noted on the API spec : TODO:
            /* QUITs are not sent in pipelines to Redis as it immediately will
View Full Code Here

              Log.debug (String.format("<%s> is alive", conn));
            }
            else {
              String errmsg = String.format("Error response on PING: %s", response.getStatus().toString());
              Log.error(errmsg);
              throw new ClientRuntimeException(errmsg)// NOTE: can't be sure this is a protocol BUG .. so CRE instead
            }
          }
          catch (Exception e) {
            // addressing buggy above.  notifyDisconnected gets called after we have checked it but before we
            // made the call - it is disconnected by the time the call is made and we end up here
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.