Package org.jredis.protocol

Examples of org.jredis.protocol.Request


          while(true){
        try {
                  pending = pendingQueue.take();
          try {
//            System.out.format("%s\n", pending.cmd.code);
            Request request = Assert.notNull(protocol.createRequest (pending.cmd, pending.args), "request object from handler", ProviderException.class);
            request.write(getOutputStream());
           
            pending.response = protocol.createResponse(pending.cmd);
            pending.response.read(getInputStream());
           
            pending.completion.signal();
View Full Code Here


    throws RedisException
  {
   
    if(!isConnected()) throw new NotConnectedException ("Not connected!");
   
    Request      request = null;
    Response    response = null;
    ResponseStatus  status = null;
   
    try {
      // 1 - Request
      //        Log.log("RedisConnection - requesting ..." + cmd.code);
     
      request = Assert.notNull(protocol.createRequest (cmd, args), "request object from handler", ProviderException.class);
      request.write(super.getOutputStream());

      // 2 - response
      //        Log.log("RedisConnection - read response ..." + cmd.code);
      response = Assert.notNull(protocol.createResponse(cmd), "response object from handler", ProviderException.class);
      response.read(super.getInputStream());
View Full Code Here

  public Response serviceRequest (Command cmd, byte[]... args)
    throws RedisException
  {
    if(!isConnected()) throw new NotConnectedException ("Not connected!");
   
    Request      request = null;
    Response    response = null;
    ResponseStatus  status = null;
    Protocol    protocol = Assert.notNull(getProtocolHandler(), "thread protocol handler", ProviderException.class);

    try {
      // 1 - Request
      //        Log.log("RedisConnection - requesting ..." + cmd.code);
     
      request = Assert.notNull(protocol.createRequest (cmd, args), "request object from handler", ProviderException.class);
      request.write(super.getOutputStream());

      // 2 - response
      //        Log.log("RedisConnection - read response ..." + cmd.code);
      response = Assert.notNull(protocol.createResponse(cmd), "response object from handler", ProviderException.class);
      response.read(super.getInputStream());
View Full Code Here

    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());
      else {
        pendingQuit = true;
        isActive.set(false);
//        heartbeat.exit();
      }
View Full Code Here

          final BlockingQueue<PendingRequest>  _pendingQueue = getPendingQueue();
          while(true){
        try {
                  pending = _pendingQueue.take();
          try {
            Request request = Assert.notNull(protocol.createRequest (pending.cmd, pending.args), "request object from handler", ProviderException.class);
            request.write(getOutputStream());
           
            pending.response = protocol.createResponse(pending.cmd);
            pending.response.read(getInputStream());
           
            pending.completion.signal();
View Full Code Here

   
    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);
   
    if(cmd == Command.CONN_FLUSH) {
      Log.log("%s not supported -- ignored", cmd.code);
      return pendingResponse;
    }
   
    synchronized (serviceLock) {
     
      if(cmd != Command.QUIT) {
        request.write(getOutputStream());
      }
      else {
        pendingQuit = true;
        isActive.set(false);
      }
View Full Code Here

TOP

Related Classes of org.jredis.protocol.Request

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.