Package com.dianping.cat.message

Examples of com.dianping.cat.message.Transaction.complete()


      Transaction t2 = Cat.getProducer().newTransaction("Cache.local", "Method");
      Cat.getProducer().newEvent("PigeonService.client", "192.168.7.77");
      t2.addData("key and value");

      Thread.sleep(11);
      t2.complete();
      t.complete();
    }
  }

  @Test
View Full Code Here


      Transaction t2 = Cat.getProducer().newTransaction("Cache.local", "Method");
      Cat.getProducer().newEvent("PigeonService.client", "192.168.7.77");
      t2.addData("key and value");

      Thread.sleep(11);
      t2.complete();
      t.complete();
    }
  }

  @Test
View Full Code Here

  public void sendLongURLTransaction() throws Exception {
    for (int i = 0; i < 10; i++) {
      Transaction t = Cat.getProducer().newTransaction("URL", "Method6");
      t.addData("key and value");
      Thread.sleep(60);
      t.complete();
    }
  }

  @Test
  public void sendLongSQLTransaction() throws Exception {
View Full Code Here

      t.setStatus(Message.SUCCESS);
    } catch (Throwable e) {
      cat.logError(e);
      t.setStatus(e);
    } finally {
      t.complete();

      m_logger.info(String.format("Finished %s tasks in period [%s, %s]", m_tasks.size(), df.format(startDate),
            df.format(endDate)));
    }
  }
View Full Code Here

      m_logger.info("Error timestamp:" + m_errorTimestampDomains);
      t.setStatus(Transaction.SUCCESS);
    } catch (Exception e) {
      t.setStatus(e);
    } finally {
      t.complete();
    }
  }

  @Override
  public void enableLogging(Logger logger) {
View Full Code Here

      t.setStatus(Message.SUCCESS);
    } catch (RuntimeException e) {
      cat.logError(e);
      t.setStatus(e);
    } finally {
      t.complete();
    }
  }

  @Override
  public void enableLogging(Logger logger) {
View Full Code Here

        t.setStatus(Transaction.SUCCESS);
      } catch (Exception e) {
        Cat.logError(e);
        t.setStatus(e);
      } finally {
        t.complete();
      }
    }
  }

  public class MessageSender implements Task {
View Full Code Here

    Threads.forGroup().start(new TimedThread(t2, 100)); // will be back in time

    TimeUnit.MILLISECONDS.sleep(200);

    t.setStatus(Message.SUCCESS);
    t.complete();
  }

  @Test
  public void testTaggedTransaction() throws Exception {
    Transaction t = Cat.newTransaction("TaggedRoot", "Root");
View Full Code Here

    Threads.forGroup().start(new TaggedThread(100, "Tag2"));

    TimeUnit.MILLISECONDS.sleep(200);

    t.setStatus(Message.SUCCESS);
    t.complete();
  }

  static class TaggedThread extends Thread {
    private int m_timeout;
View Full Code Here

        Cat.getManager().bind(m_tag, "Child Tagged Thread");
      } catch (Exception e) {
        Cat.logError(e);
        t.setStatus(e);
      } finally {
        t.complete();
      }
    }
  }

  static class TimedThread extends Thread {
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.