Package pt.opensoft.util

Examples of pt.opensoft.util.Timer.ellapsed()


        try {
          Timer timer = new Timer();
          timer.start();
          // write message request to server
          String request = (String) iterator.next();
          if (request != null) _logger.info(timer.ellapsed(), "[SENT] {" + request + "}");
          protocol.write(request);
          // read message response from server
          response = protocol.read();
          if (response != null) _logger.info(timer.ellapsed(), "[RCVD] {" + response + "}");
        } finally {
View Full Code Here


          String request = (String) iterator.next();
          if (request != null) _logger.info(timer.ellapsed(), "[SENT] {" + request + "}");
          protocol.write(request);
          // read message response from server
          response = protocol.read();
          if (response != null) _logger.info(timer.ellapsed(), "[RCVD] {" + response + "}");
        } finally {
          protocol.close();
        }
      }
    } catch (IOException e) {
View Full Code Here

        this.logger.setLevel(Level.DEBUG);
      } else {
        this.logger.setLevel(Level.INFO);
      }
     
      this.logger.debug("BEFORE SEND " + timer.ellapsed() + " ms");

      if (this.isJavaHttpConnection) {
        response = this.javaHttpConnection.send();
      } else {
        response = this.httpConnection.send();
View Full Code Here

        response = this.javaHttpConnection.send();
      } else {
        response = this.httpConnection.send();
      }
     
      this.logger.debug("AFTER  SEND " + timer.ellapsed() + " ms");
     
      // n�o basta o debug estar ligado para se mostrar a resposta do servidor. nesse caso o logger ter� de estar em finer
      this.logger.finer("RECEIVED    \n" + response);
    } catch (ConnectionTimeoutException e) {
      ex = e;
View Full Code Here

      }
      ex = e;
      throw e;
    } finally {
      timer.stop();
      boolean tooLong = (this.threshold > 0 && timer.ellapsed() > this.threshold);
      if (tooLong) {
        this.logger.push("too long");
      }
      if (timeout) {
        this.logger.push("timeout");
View Full Code Here

      }
      if (timeout) {
        this.logger.push("timeout");
      }
      if (ex != null && !timeout) {
        this.logger.error(timer.ellapsed(), ex.getMessage());
      } else if (tooLong || timeout) {
        logger.warning(timer.ellapsed(), this.user + " " + this.application + " [" + this.url + "]");
      } else {
        logger.debug(timer.ellapsed(), this.user + " " + this.application + " [" + this.url + "]");
      }
View Full Code Here

        this.logger.push("timeout");
      }
      if (ex != null && !timeout) {
        this.logger.error(timer.ellapsed(), ex.getMessage());
      } else if (tooLong || timeout) {
        logger.warning(timer.ellapsed(), this.user + " " + this.application + " [" + this.url + "]");
      } else {
        logger.debug(timer.ellapsed(), this.user + " " + this.application + " [" + this.url + "]");
      }
      this.logger.pop();
      if (tooLong) {
View Full Code Here

      if (ex != null && !timeout) {
        this.logger.error(timer.ellapsed(), ex.getMessage());
      } else if (tooLong || timeout) {
        logger.warning(timer.ellapsed(), this.user + " " + this.application + " [" + this.url + "]");
      } else {
        logger.debug(timer.ellapsed(), this.user + " " + this.application + " [" + this.url + "]");
      }
      this.logger.pop();
      if (tooLong) {
        this.logger.pop();
      }
View Full Code Here

          try {
            consume(product);
            exception = null;
          } catch (Exception e) {
            exception = e;
            logger.error(timer.ellapsed(), "INTERRUPTED FOR " + new Time(sleepOnError) + ": " + e.getMessage());
            sleep(sleepOnError);
            reset();
          } catch (Throwable e) {
            storage.recycle(product);
            throw e;
View Full Code Here

          } catch (Throwable e) {
            storage.recycle(product);
            throw e;
          }
        } while (exception != null);
        logger.debug(timer.ellapsed(), "CONSUMED " + product);
        stats.add();
      }
    } catch (Throwable e) {
      logger.error("ABORTED: " + e.getMessage(), e);
      error(e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.