Package rabbit.util

Examples of rabbit.util.Logger


    public void timeout () {
  reader.timeout ();
    }
   
    public void run () {
  Logger logger = getLogger ();
  try {
      if (buffer == null)
    allocateBuffer ();
      // read http request
      // make sure we have room for reading.
      int pos = buffer.position ();
      buffer.limit (buffer.capacity ());
      int read = channel.read (buffer);
      if (read == -1) {
    closeDown ();
    reader.closed ();
    return;
      }
      tl.read (read);
      buffer.position (startParseAt);
      buffer.limit (read + pos);
      parseBuffer ();
  } catch (IOException e) {
      logger.logWarn ("Failed to handle connection: " + e);
      reader.failed (e);
  }
    }
View Full Code Here


     *  Failure to verify response => treat all of data as content = HTTP/0.9.
     */
    private boolean verifyResponse () throws IOException
  // some broken web servers (apache/2.0.4x) send multiple last-chunks
  if (buffer.remaining () > 4 && matchBuffer (EXTRA_LAST_CHUNK)) {
      Logger log = getLogger ();
      log.logWarn ("Found a last-chunk, trying to ignore it.");
      buffer.position (buffer.position () + EXTRA_LAST_CHUNK.capacity ());
      return verifyResponse ();
  }

  if (buffer.remaining () > 4 && !matchBuffer (HTTP_IDENTIFIER)) {
      Logger log = getLogger ();
      log.logWarn ("http response header with odd start:" +
       getBufferStartString (5));
      header = new HttpHeader ();
      header.setStatusLine ("HTTP/1.1 200 OK");
      header.setHeader ("Connection", "close");
      return true;
View Full Code Here

    private void loadHttpFilters (String filters, List<HttpFilter> ls,
          Config config, HttpProxy proxy) {
  String[] filterArray = filters.split (",");
  for (String className : filterArray) {
      Logger log = proxy.getLogger ();
      try {
    className = className.trim ();
    Class<? extends HttpFilter> cls =
        Class.forName (className).asSubclass (HttpFilter.class);
    HttpFilter hf = cls.newInstance ();
    hf.setup (log, config.getProperties (className));
    ls.add (hf);
      } catch (ClassNotFoundException ex) {
    log.logError ("Could not load class: '" +
            className + "' " + ex);
      } catch (InstantiationException ex) {
    log.logError ("Could not instansiate: '" +
            className + "' " + ex);
      } catch (IllegalAccessException ex) {
    log.logError ("Could not access: '" +
            className + "' " + ex);
      }
  }
    }
View Full Code Here

      return getError (con, header);
  String rpwd = null;
  try {
      rpwd = getBackendPassword (con.getProxy ().getLogger (), username);
  } catch (SQLException e) {
      Logger log = con.getProxy ().getLogger ();
      log.logWarn ("Exception when trying to get user: " + e);
      closeDB (con);
  }
  if (rpwd == null || !rpwd.equals (pwd))
      return getError (con, header);
  return null;
View Full Code Here

  if (db == null)
      return;
  try {
      db.close ();
  } catch (SQLException e) {
      Logger log = con.getProxy ().getLogger ();
      log.logWarn ("failed to close database: " + e);
  }
  db = null;
    }
View Full Code Here

TOP

Related Classes of rabbit.util.Logger

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.