You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by se...@apache.org on 2001/10/26 06:51:14 UTC

cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets/debug Counter.java

serge       01/10/25 21:51:14

  Added:       src/java/org/apache/james/transport/mailets/debug
                        Counter.java
  Log:
  Simple mailet that counts in memory and logs the counter.  Useful for testing how many messages gets through.
  
  Revision  Changes    Path
  1.1                  jakarta-james/src/java/org/apache/james/transport/mailets/debug/Counter.java
  
  Index: Counter.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.james.transport.mailets.debug;
  
  import org.apache.mailet.*;
  
  /**
   * A simple in memory counter.  Designed to count messages sent to this recipient
   * for debugging purposes.
   *
   * @author  Serge Knystautas <se...@lokitech.com>
   */
  public class Counter extends GenericMailet {
      int counter = 0;
  
      public void service(Mail mail) {
          //Do nothing
          counter++;
          log(counter + "");
          mail.setState(Mail.GHOST);
      }
  
      public String getMailetInfo() {
          return "Counter Mailet";
      }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org